XML Xpath issue

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
deepa.y
Participant
Posts: 56
Joined: Mon Nov 28, 2011 10:47 pm
Location: Bangalore

XML Xpath issue

Post by deepa.y »

Hi,
I have the following xml file.
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<ns2:MessageHeader xmlns="http://csi.cingular.com/CSI/Namespaces/ ... aModel.xsd"
xmlns:ns2="http://csi.cingular.com/CSI/Namespaces/ ... Header.xsd">
<ns2:TrackingMessageHeader>
<version>v52</version>
<messageId>4034</messageId>
</ns2:TrackingMessageHeader>
</ns2:MessageHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<InquireWirelineServiceMaintenanceDetailsRequest xmlns="http://csi.cingular.com/CSI/Namespaces/ ... equest.xsd" xmlns:ns2="http://csi.cingular.com/CSI/Namespaces/ ... aModel.xsd">
<ServiceIdentifier>
<ns2:telephoneNumber>7155778246</ns2:telephoneNumber>
</ServiceIdentifier>
<attribute>UNBUNDLED_NETWORK_ELEMENT_ID</attribute>
</InquireWirelineServiceMaintenanceDetailsRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

When i am importing the table definition of the above xml file,the elements are getting xpath with '???' in place of namespace prefix.
For example,for element Version,Xpath is
/SOAP-ENV:Envelope/SOAP-ENV:Header/???:MessageHeader/???:TrackingMessageHeader/ns1:version/text()So,my job is getting aborted with the error
"Unexpected termination by unix signal 11(SIGSEGV)".[/b]
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Not sure why you received the ??? ...that's one I haven't seen before. I'd have to try it.

....but in the meantime just edit them out of the Description and try it. It will probably work just fine.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
deepa.y
Participant
Posts: 56
Joined: Mon Nov 28, 2011 10:47 pm
Location: Bangalore

Post by deepa.y »

Hi Ernie,
In the xml which i have given,under the tag <ns2:messageheader>,
there is declaration for namespace ns2 as
xmlns:ns2="http://csi.cingular.com/CSI/Namespaces/Types/Public/MessageHeader.xsd.
Under the tag <SOAP-ENV:Body>,
the namespace prefix ns2 is again used and declaration is
ns2="http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.xsd"> i.e different.
So,when i am importing XML table definition,If i view in namespaces,
ns2 is being assigned with the declaration under <SOAP-ENV:Body> tag.
so "???" are getting populated in case of elements under <messageheader> tag in place of ns2.When i tried using different namespace prefixes ,then it is working fine.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Yeah....hard to say. Namespaces can be very confusing. Technically speaking, those sub-elements are "in" that particular namespace....but I'm not sure what it (xslt, what the stage is using under the covers) does with the xpath in this particular case.

I usually figure out what is needed and then zap it to get the task finished....either in the metadata (if removing the ??? works), or in the metadata also (if replacing ??? with ns2 works), or in the xml (remove all the namespaces).

If the metadata editing works, you're done. ...and if you need to zap the content, and your xml isn't "too" large, it's usually fine.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply