Document Type using Sample XML

Hi,

I need some help over webMethods Trading Network related stuff.

Inorder to define a Document type in Trading Network using a sample xml file I imported the invoice.xml file (Sample xml) using file option available in the Document type identify panel.

I found that in the parsed invoice.xml each node is prefixed with “prefix0” in the Document type screen. Like prefix0:InvoiceType…ect…where as the tag in the xml does it contain this prefix0.

Hence the XQL generated in the identify panel to extract the value in the tag “InvoiceType” (for example - invoice.xml) is (this is generated automaticaly when we click the node )

/prefix0:Invoice[0]/prefix0:InvoiceHead[0]/prefix0:InvoiceType[0]

where as the correct syntax of the XQL should be (without prefix0)

/Invoice[0]/InvoiceHead[0]/InvoiceType[0]

When I tried to test both the correct syntax XQL, as well as the prefixed one in the TN Console they are not producing the result and throwing a message
“This is not a valid query for this document”.

Hence we are unable to extract the info from the XML.

Can you please share your thought and clarrify what went wrong !!!

Thanks in advance.
Rajesh

Hi,

I need some help over webMethods Trading Network related stuff.

Inorder to define a Document type in Trading Network using a sample xml file I imported the invoice.xml file (Sample xml) using file option available in the Document type identify panel.

I found that in the parsed invoice.xml each node is prefixed with “prefix0” in the Document type screen. Like prefix0:InvoiceType…ect…where as the tag in the xml does it contain this prefix0.

Hence the XQL generated in the identify panel to extract the value in the tag “InvoiceType” (for example - invoice.xml) is (this is generated automaticaly when we click the node )

/prefix0:Invoice[0]/prefix0:InvoiceHead[0]/prefix0:InvoiceType[0]

where as the correct syntax of the XQL should be (without prefix0)

/Invoice[0]/InvoiceHead[0]/InvoiceType[0]

When I tried to test both the correct syntax XQL, as well as the prefixed one in the TN Console they are not producing the result and throwing a message
“This is not a valid query for this document”.

Hence we are unable to extract the info from the XML.

Can you please share your thought and clarrify what went wrong !!!

Thanks in advance.
Rajesh

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Hi ,

In connection to the above problem i tried another xml without name space prefix. Still my TN is throwing the same error. Is it a problem due to the inbuild database used by TN.

Is there any body faced similar problem of TN not recoginising the documeth with all required defn such as root tag and identify query defined correctly.

Help me

cheers,
rajesh

Here’s my take on the situation:
If the XML you’re expecting has or may have namespaces (including the default namespace), your XQL queries MUST contain a namespace.

So if someone sends you an XML file that has no namespaces in front of any of the elements, but they declare a default namespace, your XQL won’t work unless it has a namespace in it. You can set all the namespaces you expect to receive and just use one of them in your XQL query.

The only way your situation will work (no namespace in the XQL) is if there is no namespace in the XML file, and no default namespace declared at the root tag level.

Will Kriski