Note that there are some explanatory texts on larger screens.

plurals
  1. POEfficient XML Parsing for specific xsi:type
    primarykey
    data
    text
    <p>All,</p> <p>I have a directory of large xml files with the following setup:</p> <pre><code>&lt;io:InfoObjects xmlns:crole="http://enterprise.businessobjects.com/3.0/customrole" xmlns:fo="http://enterprise.businessobjects.com/3.0/folder" xmlns:io="http://enterprise.businessobjects.com/3.0/infoobject" xmlns:md.dc="http://enterprise.businessobjects.com/3.0/metadata.dataconnection" xmlns:un="http://enterprise.businessobjects.com/3.0/universe" xmlns:wi="http://enterprise.businessobjects.com/3.0/webi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://enterprise.businessobjects.com/3.0/customrole BusinessObjects_CustomRole.xsd http://enterprise.businessobjects.com/3.0/folder BusinessObjects_Folder.xsd http://enterprise.businessobjects.com/3.0/infoobject BusinessObjects_InfoObject.xsd http://enterprise.businessobjects.com/3.0/metadata.dataconnection BusinessObjects_MetaData_DataConnection.xsd http://enterprise.businessobjects.com/3.0/universe BusinessObjects_Universe.xsd http://enterprise.businessobjects.com/3.0/webi BusinessObjects_Webi.xsd" version="1200" illegalCharsEncoded="true"&gt; &lt;io:InfoObject xsi:type="wi:Webi"&gt; &lt;io:ID&gt;1&lt;/io:ID&gt; &lt;io:Name&gt;MyName&lt;/io:Name&gt; &lt;io:Description&gt;NoDesc&lt;/io:Description&gt; &lt;/io:InfoObject&gt; &lt;/io:InfoObjects&gt; </code></pre> <p>Original Question: (in Java 1.5) I am currently using dom and parsing through each node/elemnt until i find my specific type of wi:Webi. This seems terribily enefficient and feel that I am missing a Java function that would allow me to simply extract all elements/nodes with the type of "wi:Webi". Is there a simpler solution?</p> <p>Updates: I am starting to use XPath but, am having issues with the expression creation. So far I am trying:</p> <pre><code>xpath.compile("//*[@xsi:type='wi:Webi']"); </code></pre> <p>According to other stackoverflow posts who had similar issues I need to define in my expression the namespace. I was hopeing that the *[@xsi:type] search would state for any child with type of wi:Webi return it as in the nodelist.</p>
    singulars
    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