Note that there are some explanatory texts on larger screens.

plurals
  1. PORead XML file with several namespaces
    primarykey
    data
    text
    <p>I have an XML file with several namespaces. But i cant get value/ text from any of the nodes.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!--XML file created by Microsoft Dynamics C5--&gt; &lt;Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2"&gt; &lt;cbc:UBLVersionID schemeAgencyID="320" schemeAgencyName="urn:oioubl:id:profileid-1.1"&gt;2.0&lt;/cbc:UBLVersionID&gt; &lt;cbc:CustomizationID&gt;OIOUBL-2.02&lt;/cbc:CustomizationID&gt; &lt;cbc:ProfileID schemeID="urn:oioubl:id:profileid-1.2" schemeAgencyID="320"&gt;Procurement-BilSim-1.0&lt;/cbc:ProfileID&gt; &lt;cbc:ID&gt;88481&lt;/cbc:ID&gt; &lt;cbc:IssueDate&gt;2012-05-21&lt;/cbc:IssueDate&gt; &lt;cbc:InvoiceTypeCode listID="urn:oioubl:codelist:invoicetypecode-1.1" listAgencyID="320"&gt;380&lt;/cbc:InvoiceTypeCode&gt; &lt;cbc:DocumentCurrencyCode&gt;DKK&lt;/cbc:DocumentCurrencyCode&gt; &lt;cbc:AccountingCost&gt;&lt;/cbc:AccountingCost&gt; &lt;cac:OrderReference&gt; &lt;cbc:ID&gt;ZZ&lt;/cbc:ID&gt; &lt;cbc:SalesOrderID&gt;36433&lt;/cbc:SalesOrderID&gt; &lt;cbc:IssueDate&gt;2012-05-21&lt;/cbc:IssueDate&gt; &lt;/cac:OrderReference&gt; &lt;/Invoice&gt; </code></pre> <p>I'm trying to read some of the nodes but i cant. Here is an example.</p> <pre><code>XmlDocument doc = new XmlDocument(); doc.Load(@"C:\temp\88481.xml"); XmlNamespaceManager manager = new XmlNamespaceManager(doc.NameTable); manager.AddNamespace("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"); manager.AddNamespace("cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"); manager.AddNamespace("qdt", "urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2"); manager.AddNamespace("xsd", "http://www.w3.org/2001/XMLSchema"); manager.AddNamespace("udt", "urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2"); manager.AddNamespace("ccts", "urn:un:unece:uncefact:documentation:2"); manager.AddNamespace("ext", "urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"); manager.AddNamespace("", "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"); XmlNodeList list = doc.SelectNodes("//Invoice/cbc:ID", manager); </code></pre> <p>But the node list have no elements ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload