XPATH vs DOM  tests acomplishied

hi, i performed some test trying to select one node in a document with 10000 nodes (<name first="ssss" last="sss">) and the test said:
[bold]Using xpath[bold]
String xpath = "/doc/name[@first=\"Rodrigo\"]";
Node node = XPathAPI.selectSingleNode(doc, xpath);[bold]it delay like 1970 milliseconds[bold]
[bold]Using dom[bold]
NodeList nodeList = (NodeList)doc.getElementsByTagName("name");
    int length = nodeList.getLength();
    for (int i = 0; i < length; i++) {
      Element node = (Element)nodeList.item(i);
      String name = node.getAttribute("first");
      if (name.equals("Rodrigo")) {
        break;
    }[bold]it delay like 1010 milliseconds[bold]
HOW CAN IT BE ?????
xpath is more slower than dom ??????
thanks
Rodrigo Gonzalez Asensio
Researcher & Developer
Buenos Aires - Argentina

Hello Rodrigo,
I shall not be surprised with your result. DOM builds a tree and keeps it in the memory.
While (depending upon the XSLT engine) XSLT prredominantly uses SAX. SAX if fast for through reading. But if the application requires data that cannot be retrieved in one pass multiple passes are required (I do not know the exact structure of your document). This multiple pass does consume longer time.
DOM takes a huge amount of memory - but nobody ever accused it to be very slow, sepecially if iterative reading is involved.
Thus, your result may be entirely correct. If I were you, I would also check the configuration and environment of the system.
If you require clarification, please contact me [email protected]
Ironluca

Similar Messages

  • Using XPath for DOM traversal

    This question falls into the category of 'I know it's possible, I just need to find the idom in Java'.
    I'm coming from a MSFT world were the DOM-centric model of XML processing makes heavy use of XPATH for node selection. Basically using the method element.selectNodes(XPathExpresson) allows one to quickly extract the relevant subset of the parsed tree in the DOM as a nodeList. I've become accustomed to using XML for all strucutured storage that doesn't require a full database.
    The W3C DOM Level 3 spec supports evaluateExpression() for this purpose, but I can't believe that Java developers are still using tree traversal waiting for the spec to be implemented. I suppose that I could use getNodesByTagName(), but this is a chainsaw, and I need a scalpel. Anyway, I'm trying to figure out how, exactly, this gets done in Java.
    I figure the following are possibilities:
    1) It's in JAXP and I missed it
    2) One or more of the XML parsers supports XPATH as an extention
    3) There's a common package that sits on top of the DOM Document.
    4) There's a standard way to apply and XSLT methods to the DOM document
    5) Something I've never thought of.
    This is a generalized problem for me, so I can't rely on object serialization, Java-XML data mapping, etc. Any guidance would be greatly appreciated.

    I've written a Config file reader for XML in java,
    and it extracts values using XPath. This is
    some of the code you'll need:
    imports:
    import javax.xml.transform.TransformerException;
    import org.w3c.dom.*;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.apache.xerces.parsers.DOMParser;
    import org.apache.xpath.XPathAPI;
    import org.apache.xpath.objects.*;
    Document doc=....;
    * returns a single DOM Node from the config file.
    public Node getNode(String xpath) throws ConfigException {
    try {
    return XPathAPI.selectSingleNode(doc, xpath);
    } catch (TransformerException e) {
    throw new ConfigException("Can't find '"+xpath+"' ("+e.getMessage()+")");

  • XPath and DOM

    Hi,
    I am wondering how to incorporate support for XPath into my XML DOM app. Do I need to add another library or is support provided in any of the std Java API classes?
    Thanks for help in advance,
    Claire

    Hello
    Xalan, part of the XML apache project (xml.apache.org), offers a module with XPath support (org.apache.xpath). I'm not sure, if Xalan made it into the standard version of the JDK 1.4.
    If you use a XML database, the XML:DB (www.xmldb.org) api also included XPath support as an optional module.
    Mathias

  • XPath vs Dom Traversal

    I've heard XPath is more efficient than using the DOM api to traverse the XML. I am just curious if this is true or not.
    Thanks

    Yes , Xpath is faster . Probabaly , your DOM package supports XPath either directly or via an add-on, so you can use both.

  • XPath query to test for the existence of a tag

    I have the following piece of XML and I need to write a query against it that will check for the existence of the <content> tag in XML body... In other words, I want to get the row if the <content> tag is absent from the Asset portion of the metadata but only for Asset_Class = "encrypted"
    ADI>

    <Metadata>
    <AMS Asset_Class="package" Asset_ID="TTVV4136100000000001" Asset_Name="Package_4136" Creation_Date="2004-07-12" Description="Test package C1" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Provider_Content_Tier" Value="HBO1"/>
    <App_Data App="MOD" Name="Metadata_Spec_Version" Value="CableLabsVOD1.1"/>
    </Metadata>

    <Asset>

    <Metadata>
    <AMS Asset_Class="title" Asset_ID="TTVV4136100000000002" Asset_Name="Package_4136_Title" Creation_Date="2004-07-12" Description="Test package C1 title" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Distributor_Royalty_Percent" Value="12.11"/>
    <App_Data App="MOD" Name="Contract_Name" Value="Contract Name"/>
    <App_Data App="MOD" Name="Box_Office" Value="184000000"/>
    <App_Data App="MOD" Name="MSORating" Value="R"/>
    <App_Data App="MOD" Name="Distributor_Royalty_Flat_Rate" Value="15.549"/>
    <App_Data App="MOD" Name="Studio_Name" Value="N2Broadband, INC"/>
    <App_Data App="MOD" Name="Season_Premiere" Value="N"/>
    <App_Data App="MOD" Name="Country_of_Origin" Value="USA"/>
    <App_Data App="MOD" Name="Actors_Display" Value="Harrison Ford, Tommy Lee Jones, Sela Ward"/>
    <App_Data App="MOD" Name="Propagation_Priority" Value="1"/>
    <App_Data App="MOD" Name="Title_Sort_Name" Value="Pkg C1"/>
    <App_Data App="MOD" Name="Director" Value="Villaveces,Eduardo"/>
    <App_Data App="MOD" Name="Genre" Value="Test"/>
    <App_Data App="MOD" Name="Director" Value="Robertson,Mark"/>
    <App_Data App="MOD" Name="Summary_Short" Value="Test Package C1 Summary_Short"/>
    <App_Data App="MOD" Name="Closed_Captioning" Value="Y"/>
    <App_Data App="MOD" Name="Studio_Royalty_Minimum" Value="13.000"/>
    <App_Data App="MOD" Name="Producers" Value="phillips,chris"/>
    <App_Data App="MOD" Name="Studio" Value="Warner Bros."/>
    <App_Data App="MOD" Name="Rating" Value="G"/>
    <App_Data App="MOD" Name="Rating" Value="TV-G"/>
    <App_Data App="MOD" Name="Category" Value="Encryption Test"/>
    <App_Data App="MOD" Name="Provider_QA_Contact" Value="[email protected]"/>
    <App_Data App="MOD" Name="Display_As_Last_Chance" Value="40"/>
    <App_Data App="MOD" Name="Writer_Display" Value="test of writers disp"/>
    <App_Data App="MOD" Name="Home_Video_Window" Value="45"/>
    <App_Data App="MOD" Name="Billing_ID" Value="00270"/>
    <App_Data App="MOD" Name="Episode_ID" Value="E ID"/>
    <App_Data App="MOD" Name="Title_Brief" Value="test content"/>
    <App_Data App="MOD" Name="Display_Run_Time" Value="00:03"/>
    <App_Data App="MOD" Name="Maximum_Viewing_Length" Value="00:01:00"/>
    <App_Data App="MOD" Name="Distributor_Name" Value="fox movies"/>
    <App_Data App="MOD" Name="Studio_Royalty_Percent" Value="12.00"/>
    <App_Data App="MOD" Name="Audience" Value="Adult"/>
    <App_Data App="MOD" Name="Distributor_Royalty_Minimum" Value="14.552"/>
    <App_Data App="MOD" Name="Display_As_New" Value="10"/>
    <App_Data App="MOD" Name="Episode_Name" Value="E name"/>
    <App_Data App="MOD" Name="Preview_Period" Value="60"/>
    <App_Data App="MOD" Name="Title" Value="Test Package C1"/>
    <App_Data App="MOD" Name="Summary_Long" Value="Test Package C1 Summary_Long"/>
    <App_Data App="MOD" Name="Actors" Value="davis,bill"/>
    <App_Data App="MOD" Name="Summary_Medium" Value="Test Package C1 Summary_Medium"/>
    <App_Data App="MOD" Name="Licensing_Window_Start" Value="2009-10-01"/>
    <App_Data App="MOD" Name="Type" Value="title"/>
    <App_Data App="MOD" Name="Suggested_Price" Value="3.95"/>
    <App_Data App="MOD" Name="Run_Time" Value="00:01:02"/>
    <App_Data App="MOD" Name="Chapter" Value="00:01:00:00,test1"/>
    <App_Data App="MOD" Name="Licensing_Window_End" Value="2011-11-01"/>
    <App_Data App="MOD" Name="Subscriber_View_Limit" Value="2003-03-10,2003-03-12,12"/>
    <App_Data App="MOD" Name="Season_Finale" Value="Y"/>
    <App_Data App="MOD" Name="Year" Value="1993"/>
    <App_Data App="MOD" Name="Studio_Royalty_Flat_Rate" Value="14.000"/>
    </Metadata>

    <Asset>

    <Metadata>
    <AMS Asset_Class="movie" Asset_ID="TTVV4136100000000003" Asset_Name="Package_4136_Movie" Creation_Date="2004-07-12" Description="Test Package movie" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Type" Value="movie"/>
    <App_Data App="MOD" Name="Encryption" Value="Y"/>
    <App_Data App="MOD" Name="Audio_Type" Value="Dolby Digital"/>
    <App_Data App="MOD" Name="Screen_Format" Value="Standard"/>
    <App_Data App="MOD" Name="Copy_Protection" Value="Y"/>
    <App_Data App="MOD" Name="Content_FileSize" Value="6902796"/>
    <App_Data App="MOD" Name="Content_CheckSum" Value="81647e1a3d38c4e64af3bbcf15711b40"/>
    </Metadata>
    <Content Value="movie4136.mpg"/>
    </Asset>

    <Asset>

    <Metadata>
    <AMS Asset_Class="poster" Asset_ID="TTVV4136100000000005" Asset_Name="Package_4136_Poster" Creation_Date="2004-07-12" Description="Test Package poster desc" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Type" Value="poster"/>
    <App_Data App="MOD" Name="Image_Aspect_Ratio" Value="240x480"/>
    <App_Data App="MOD" Name="Content_CheckSum" Value="999dcd45d6374feb380c0f49029911b5"/>
    <App_Data App="MOD" Name="Content_FileSize" Value="30"/>
    </Metadata>
    <Content Value="poster4136.bmp"/>
    </Asset>

    <Asset>

    <Metadata>
    <AMS Asset_Class="preview" Asset_ID="TTVV4136100000000004" Asset_Name="Package_4136_Preview" Creation_Date="2004-07-12" Description="Test Package Preview" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Type" Value="preview"/>
    <App_Data App="MOD" Name="Screen_Format" Value="Standard"/>
    <App_Data App="MOD" Name="Audience" Value="General"/>
    <App_Data App="MOD" Name="MSORating" Value="All-Ages"/>
    <App_Data App="MOD" Name="Audio_Type" Value="Dolby Digital"/>
    <App_Data App="MOD" Name="Languages" Value="en"/>
    <App_Data App="MOD" Name="Dubbed_Languages" Value="is"/>
    <App_Data App="MOD" Name="Subtitle_Languages" Value="is"/>
    <App_Data App="MOD" Name="Rating" Value="G"/>
    <App_Data App="MOD" Name="Rating" Value="TV-14 S"/>
    <App_Data App="MOD" Name="Run_Time" Value="00:03:54"/>
    <App_Data App="MOD" Name="Content_FileSize" Value="6902796"/>
    <App_Data App="MOD" Name="Content_CheckSum" Value="81647e1a3d38c4e64af3bbcf15711b40"/>
    </Metadata>
    <Content Value="preview4136.mpg"/>
    </Asset>

    <Asset>

    <Metadata>
    <AMS Asset_Class="encrypted" Asset_ID="TTVE0000000000202939" Asset_Name="TTVV4136100000000003.n2bb.com" Creation_Date="2010-06-28" Description="Encrypted asset for movie4136.mpg" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="1"/>
    <App_Data App="MOD" Name="Content_CheckSum" Value="81647e1a3d38c4e64af3bbcf15711b40"/>
    <App_Data App="MOD" Name="Bit_Rate" Value="3594"/>
    <App_Data App="MOD" Name="Encryption_Key_Block" Value="<?xml version="1.0" encoding="UTF-8"?><ERPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://localhost/namespaces/ERPayload.xsd"> <EncryptionRecord> <ERVer1.0> <TitleIdCode>TTVV4136100000000003</TitleIdCode> <ContentTitle>TTVV4136100000000003</ContentTitle> <EncryptionTime>2010-06-23T18:18:58Z</EncryptionTime> <OLESId>268</OLESId> <Label>12138</Label> <EncryptionMode>2</EncryptionMode> <EncryptedDataVersion>0</EncryptedDataVersion> <EncryptedDataBlock>rd00X2wXJ3uQVd6tNJDimuBMNod/zkXKmxdoR5skbFOd84eVhNdX4NQAE6Nt/iX/cz4IyHXYmYpOHVvLe5GtGFqnRxkoPhBHmMpKgFtDsDX63kgM9p00qI5SEyX4F+VNudY3GZQEQQU4qP61+dXkBYMsnGm5qV18OMnF+xThCGU=</EncryptedDataBlock> </ERVer1.0> </EncryptionRecord></ERPayload>"/>
    <App_Data App="MOD" Name="Receiver_Type" Value="MOTO"/>
    <App_Data App="MOD" Name="Asset_Encrypted" Value="TTVV4136100000000003"/>
    <App_Data App="MOD" Name="Encryption_Type" Value="oles"/>
    <App_Data App="MOD" Name="Encrypting_System_Info" Value="MOTO_OLES_1"/>
    <App_Data App="MOD" Name="Content_FileSize" Value="6902796"/>
    </Metadata>
    <Content Value="movie4136_encr.mpg"/>
    </Asset>
    </Asset>
    </ADI>

    Hi,
    You may use this in the WHERE clause :
    EXISTSNODE(xmltype_column, 'ADI/Asset/Asset[Metadata/AMS/@Asset_Class="encrypted"]/Content') = 0The XML has to be stored in an XMLType column, is that the case?

  • Would using -Xxmn option speed up an xpath/DOM application

    A developer mentioned in another thread
    "You can increase the default maximum heap size. Different OSes and JVM/versions have an upper limit for this.
    For the Sun JVM the command line option is doc'd in the docs. It is "-Xmxn" where n is replaced with something like "80m". The default size is 64m (meg) for 1.3 ."
    My question is would using the -Xxmn speed up a java application using xpath and DOM or no?

    This may speed it up if the amount of time spent garbage collecting is getting too high. As you raise the size of a heap it has to garbage collect less often given a fixed rate of allocations per unit time. Unfortunately, the time it takes to GC also rises a bit with a large heap, so your mileage may vary.
    Take a look at the rate at which you are GC'ing. use -verbose:gc to do that.
    Also, raising -XmsNNm (NN is number of megs) to raise the initial heap size can also help improve startup speed. This should be either the like amount of memory you need or some reasonable fraction of the maximum heap size (perhaps == to the max heap size). This will eliminate extra GC's and time spent to grow the heap as the application runs.
    If you are GC'ing fairly often (every few to 10 seconds) and the GC's take a fair amount of time (consistently greater than .5 to 1 seconds), you might want to further tune the heap. For Sun and Java 1.3.1, I often use something like this to run large programs and J2EE servers (the exact numbers may vary:
    java -server -Xms256m -Xmx512m -XX:NewSize=128m -XX:MaxNewSize=128m -XX:SurvivorRatio=2
    Take a look at this: http://java.sun.com/docs/hotspot/index.html
    Chuck

  • Fast XPath API

    JXP is a Fast XPath 1.0 compliant API.
    Download :
    http://www.japisoft.com/jxpath/download/unregistered.zip
    Home :
    http://www.japisoft.com/jxpath
    Forum :
    http://www.japisoft.com/forum/index.php
    News :
    Cache support for the navigator (by default enabled)
    Fixed bug for simple expressions like 1+1
    Fixed bug for // usage
    A DOM document can be used rather than an Element
    Main features :
    * High performance full XPath 1.0 solution,
    * 25% faster than jaxen,
    * SAX - like event system,
    * Inner expression tree for fast multiple document evaluation,
    * Syntax error location and cause,
    * DOM support,
    * FastParser lightweight node support,
    * Customizable API with navigator, function libraries,
    * Plugin for each node type system,
    * Lower/Uppercase feature
    * Full samples with DOM,
    * Tested on 150 XPath expressions,
    * Benchmark tests included,
    * Package of 85 Ko
    * Open source for the registered version,
    * JDK1.1 and later compliant (tested on JDK1.1.8 and JDK1.4.1)
    A.Brillant
    http://www.japisoft.com

    Mainly :
    - Speed,
    - Compact : 100Ko,
    - Pluggable kit for custom node usage,
    - JDK 1.1,
    - Featuring like lowercase/uppercase for HTML.
    Hope it replies,
    A.Brillant

  • OSB XSLT testing issue

    I am using the ALSB XQuery/XPath/XSLT Expression Testing functionality of the service bus console. However when I click execute I just get
    "Error executing the transformation: java.lang.NullPointerException" and no details. I looked at the log files at
    <domain_home>/servers/AdminServer/logs/ but I don't see any details.
    Any hints about what may be going wrong here ?

    Hi there, before going to the workmanager, can anyone explain about the socket listner? It seems like my socket listner is fully occupied when load comming in.
    Basically it seems like not releasing the socket. Can i know by defult how the socket works in WLS? I am lost, because from my understanding, each socket is base on one connection means when it reach the JMS it will ends the process and close the listner. Then when JMS proxy picking the message in the queue will perform one by one means consume the socket one by one.
    For e.g:
    1. JMS proxy pick up message>"one socket consumed">send to business service > wait for respone > respone return >"socket close"
    2. JMS proxy pick up message>"one socket consumed">send to business service > wait for respone > respone return >"socket close"
    so each time will used only one socket per transaction am i rite?
    and i received below message from the domain log
    ####<Jul 20, 2010 3:50:25 PM SGT> <Warning> <Socket> <selbgixb50ut002> <CGISOSB_MS1> <[ACTIVE] ExecuteThread: '21' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1279612225183> <BEA-000449> <Closing socket as no data read from it during the configured idle timeout of 5 secs>
    ####<Jul 20, 2010 3:50:25 PM SGT> <Warning> <Socket> <selbgixb50ut002> <CGISOSB_MS1> <[ACTIVE] ExecuteThread: '21' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1279612225183> <BEA-000449> <Closing socket as no data read from it during the configured idle timeout of 5 secs>
    I am really lost. Recommanded setting for basic Ascync process needed, and i am using the default connection factory, will this cause the problem?

  • Using XPath for associatios into BPMN process??

    Hello everybody:
    I'm using Oracle SOA and BPM Suite 11.1.1.5
    I have a BPMN process that have an entry variable of type CBEFF_BIR_Type (the xml declaration is shown below)
    <xsd:complexType name="CBEFF_BIR_Type">
                     <xsd:sequence>
                        <xsd:element name="FormatOwner" type="xsd:positiveInteger" minOccurs="1" maxOccurs="1"/>
                        <xsd:element name="FormatType" type="xsd:positiveInteger" minOccurs="1" maxOccurs="1"/>
                        <xsd:element name="BIR_Information" minOccurs="0" maxOccurs="1">
                            <xsd:complexType>
                                <xsd:sequence>
                                    <xsd:element name="BIR_Info" type="iso-iec19785-3-7:BIRInfoType" minOccurs="0"
                                         maxOccurs="1"/>
                                    <xsd:element name="BDB_Info" type="iso-iec19785-3-7:BDBInfoType" minOccurs="0"
                                         maxOccurs="1"/>
                                    <xsd:element name="SB_Info" type="iso-iec19785-3-7:SBInfoType" minOccurs="0"
                                         maxOccurs="1"/>
                                </xsd:sequence>
                            </xsd:complexType>
                        </xsd:element>
                        *<xsd:element name="BIR" type="tns:BaseBIRType"/>*
                    </xsd:sequence>
                </xsd:complexType>* BaseBIRType xml declaration*
    <xsd:complexType name="BaseBIRType"/>According to the business logic that BIR sould contain a node of type URI_BIR or BinaryBIR (xml declaration is shown below), it will never a self BaseBIRType.
    <xsd:complexType name="URI_BIR">
                    <xsd:complexContent>
                        *<xsd:extension base="tns:BaseBIRType">*
                            <xsd:sequence>
                                <xsd:element name="URI" type="xsd:anyURI"/>
                            </xsd:sequence>
                        </xsd:extension>
                    </xsd:complexContent>
                </xsd:complexType>
    <xsd:complexType name="BinaryBIR">
                    <xsd:complexContent>
                        *<xsd:extension base="tns:BaseBIRType">*
                            <xsd:sequence>
                                <xsd:element name="Binary" type="xsd:base64Binary"/>
                            </xsd:sequence>
                        </xsd:extension>
                    </xsd:complexContent>
                </xsd:complexType>As you can see, the bolded code in the first block illustrate a node of type BaseBIRType and the bolded code in the second block shows that the complex type URI_BIR and BinaryBIR are an extension of BaseBIRType. So it looks like a inheritance, as I see it.
    Inside my process I need to know what kind of node is coming inside de BIR (URI or Binary) to copy it to the correct variable type. I've tryed using the XPath Expessions provided by the IDE (+ora:instanceOf(XpathExpression, QName)+) but I had no results.
    Please someone who can guide me?, I'll appreciate any help. I'm new in XPath.
    Regards,
    isabelbernely

    As I see it you should use transformations not associations in such case. Within transformation (xslt) you should use XPath expression to test which of the concrete instance of the base type you are dealing with and proceed accordingly. That's bit ugly (depending on actual subelements to distinguish types) so there are two alternatives:
    1. use xsi:type in xml instance - an attribute which will directly indicate the type of the element (many java xml binding frameworks can output such attribute while marshalling types to xml)
    2. remodel your xsd to use substitution groups - the construct is similar but due to nature of substitution groups each concrete type will have a separate named element - easy to distinguish later in transformation

  • NIST conformance tests using JUnit

    I haven't seen anyone from Oracle on the [email protected] mailing list, so I'm posting this here just to let you guys know.
    I've been working on recasting the NIST DOM test suite for Java to use JUnit and posted an initial release last night.
    The tests can easily be run against the beta XDK's parser (or any other JAXP compliant parser), but there were a substantial number test errors and failures. Some of these may be due to test problems, but I'd guess most of them are legitimate. However, I do not have time or the motivation to investigate them.
    It does seem that you take the position that the XML declaration is treated as a processing instruction (like MSXML does) which will cause 3 tests to fail, but you can adjust the tests to accept this using
    -Dnet.sourceforge.xmlconf.domunit.acceptXMLDeclPI=true
    I've made the source for my JUnit-hosted deriviatives of the NIST test suite available at http://xmlconf.sourceforge.net. You can either download the combined source and binary
    zip file from http://sourceforge.net/project/showfiles.php?group_id=8114&release_id=31676
    or you can access the source through the CVS (http://sourceforge.net/cvs/?group_id=8114)
    The tests run using JUnit 3.5 and can test JAXP 1.0 or JAXP 1.1 compliant DOM parsers.
    Xerces-J 1.3.1 does not report any test failures, crimson.jar and the other parser tested
    had a moderate amount of test failures, but no investigation has been performed to
    determine if those failures were problems with the tests or actual non-conformances
    with the spec.
    A JBuilder 4 .jpx project and an Ant 1.2 build.xml file are provided.
    ------- readme.txt from domunit 0.0.1 ---------
    domunit 0.0.1
    domunit currently contains equivalents of the NIST DOM 1 test written for
    the JUnit test framework (http://www.junit.org) and JAXP 1.1 or 1.0 compatible parsers.
    The tests were written to allow easy migration to JavaScript using JSUnit
    (http://www.jsunit.net) and CPPUnit (http://www.xprogramming.org/software)
    To run the full set of tests, place domunit.jar, junit.jar and one of the following
    combinations of jars in the same directory or on the class path.
    xerces.jar
    xml4j.jar
    jaxp.jar and parser.jar (from Sun's JAXP 1.0 Reference Implementation)
    jaxp.jar and crimson.jar (from Sun's JAXP 1.1 Reference Implementation)
    and run:
    java -jar domunit.jar
    To test Oracle's XML Processor, place jaxp.jar from the JAXP 1.0 (not 1.1) Reference Implementation
    and xmlparserv2.jar in the domunit.jar directory and run:
    java -Djavax.xml.parsers.DocumentBuilderFactory=oracle.xml.jaxp.JXDocumentBuilderFactory
    -jar domunit.jar
    The following options can adjust the tests:
    -Dnet.sourceforge.xmlconf.domunit.isExpandEntityReferences=true
    -Dnet.sourceforge.xmlconf.domunit.isCoalescing=true
    -Dnet.sourceforge.xmlconf.domunit.acceptXMLDeclPI=true
    To build the project, use either the JBuilder 4 .jpx file or
    the Ant 1.2 build.xml file.
    Curt Arnold http://xmlconf.sourceforge.net
    [email protected]
    18 April 2001
    domunit - DOM testing on the xUnit frameworks
    Copyright (C) 2001, Curt Arnold
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    null

    I haven't seen anyone from Oracle on the [email protected] mailing list, so I'm posting this here just to let you guys know.
    I've been working on recasting the NIST DOM test suite for Java to use JUnit and posted an initial release last night.
    The tests can easily be run against the beta XDK's parser (or any other JAXP compliant parser), but there were a substantial number test errors and failures. Some of these may be due to test problems, but I'd guess most of them are legitimate. However, I do not have time or the motivation to investigate them.
    It does seem that you take the position that the XML declaration is treated as a processing instruction (like MSXML does) which will cause 3 tests to fail, but you can adjust the tests to accept this using
    -Dnet.sourceforge.xmlconf.domunit.acceptXMLDeclPI=true
    I've made the source for my JUnit-hosted deriviatives of the NIST test suite available at http://xmlconf.sourceforge.net. You can either download the combined source and binary
    zip file from http://sourceforge.net/project/showfiles.php?group_id=8114&release_id=31676
    or you can access the source through the CVS (http://sourceforge.net/cvs/?group_id=8114)
    The tests run using JUnit 3.5 and can test JAXP 1.0 or JAXP 1.1 compliant DOM parsers.
    Xerces-J 1.3.1 does not report any test failures, crimson.jar and the other parser tested
    had a moderate amount of test failures, but no investigation has been performed to
    determine if those failures were problems with the tests or actual non-conformances
    with the spec.
    A JBuilder 4 .jpx project and an Ant 1.2 build.xml file are provided.
    ------- readme.txt from domunit 0.0.1 ---------
    domunit 0.0.1
    domunit currently contains equivalents of the NIST DOM 1 test written for
    the JUnit test framework (http://www.junit.org) and JAXP 1.1 or 1.0 compatible parsers.
    The tests were written to allow easy migration to JavaScript using JSUnit
    (http://www.jsunit.net) and CPPUnit (http://www.xprogramming.org/software)
    To run the full set of tests, place domunit.jar, junit.jar and one of the following
    combinations of jars in the same directory or on the class path.
    xerces.jar
    xml4j.jar
    jaxp.jar and parser.jar (from Sun's JAXP 1.0 Reference Implementation)
    jaxp.jar and crimson.jar (from Sun's JAXP 1.1 Reference Implementation)
    and run:
    java -jar domunit.jar
    To test Oracle's XML Processor, place jaxp.jar from the JAXP 1.0 (not 1.1) Reference Implementation
    and xmlparserv2.jar in the domunit.jar directory and run:
    java -Djavax.xml.parsers.DocumentBuilderFactory=oracle.xml.jaxp.JXDocumentBuilderFactory
    -jar domunit.jar
    The following options can adjust the tests:
    -Dnet.sourceforge.xmlconf.domunit.isExpandEntityReferences=true
    -Dnet.sourceforge.xmlconf.domunit.isCoalescing=true
    -Dnet.sourceforge.xmlconf.domunit.acceptXMLDeclPI=true
    To build the project, use either the JBuilder 4 .jpx file or
    the Ant 1.2 build.xml file.
    Curt Arnold http://xmlconf.sourceforge.net
    [email protected]
    18 April 2001
    domunit - DOM testing on the xUnit frameworks
    Copyright (C) 2001, Curt Arnold
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    null

  • How to Edit perticular node in XML

    How to edit Perticular XML node ?
    <root>
    <node1>
    <data1>   dsfs  </data1>
    <data2>   dsfs  </data2>
    <data3>   dsfs  </data3>
    <data4>   dsfs  </data4>
    </node1>
    </root>What should i do to change data3 value, means edit data of <data3> ??
    help me

    Retriece data3 node with XPath or DOM. Set node value with setNodeValue() method.

  • Xsql multiple table insert

    I'm having trouble getting my xml document inserted into multiple tables. My xml has a parent child relationship. The main node is the parent I'll call <CAKE> then later on in the xml doc it has a node called <INGREDIENTS> which is a repeating element (more than 1). I need to insert information from the root node, <CAKE> into 1 table and all the info from <INGREDIENTS> node into another table.
    I've tried to get Steve Muench's book a try (chapter 14) but when I try to run the examples from the book (XMLLoader) i get the following error.
    C:\jdev9i\jdk1.3\bin\javaw.exe -ojvm -classpath C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14\classes;C:\oracle\ora81\RDBMS\jlib\xsu12.jar;C:\jdev9i\lib\xmlparserv2.jar;C:\jdev9i\jdev\lib\jdev-rt.jar;C:\jdev9i\jdbc\lib\classes12.jar;C:\jdev9i\jdbc\lib\nls_charset12.jar;C:\jdev9i\jlib\jdev-cm.jar;C:\jdev9i\rdbms\jlib\xsu12.jar;C:\jdev9i\lib\xmlparserv2.jar;C:\jdev9i\lib\xmlcomp.jar;C:\jdev9i\lib\oraclexsql.jar;C:\jdev9i\rdbms\jlib\xsu12.jar;C:\jdev9i\lib\xsqlserializers.jar;C:\jdev9i\lib\xmlparserv2.jar;C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14\classes;C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14\classes;C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14\classes -
    mx50m
    XMLLoader -file deptempdepend.xml -transform deptempdepend.xsl
    Processed 1 Documents
    Node doesn't belong to the current document.
    Error: java.lang.NullPointerException
    Process exited with exit code 0.

    I made the changes in the java files as per the previous
    reference, but I'm still getting an error. Seeing that I'm not
    much of a Java guy yet, I'm not sure where to debug the error.
    So here it is:
    XMLLoader -file deptempdepend.xml -transform deptempdepend.xsl
    Processed 1 Documents
    null
    Error: java.lang.NullPointerException
    Process exited with exit code 0.
    I tried to debug it and came to the conclusion that it is
    failing at line 22 of ConnectionFactory
    The value connNode is returend as null.
    I don't understand why:
    I ran testxpath.exe for the connections file.
    C:\jdev9i\jdev\mywork\orxmlapp\Examples\ch14>testxpath connections.xml
    Type an XPath expression to test and press [Enter]
    To quit, press [Enter] without entering a path.
    connections.xml> /connections/connection[@name='doug']
    <connection name="doug">
    <username>user</username>
    <password>password</password>
    <dburl>jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=dtxml.hmms)))</dburl>
    <driver>oracle.jdbc.driver.OracleDriver</driver>
    </connection>
    connections.xml>
    and it returned what i thought would be the correct nodes.
    Any help would be appreciated
    Doug

  • Parsing across multiple namespaces... best practice?

    Howdy all, here's my situation:
    I am attempting to create a simple interface to a particular type of webdav server which has some unusual XML data coming back, and need some advice on the best way to parse this XML.
    I have a generic "query" object which consists of a set of "Fields", a "Scope" and a set of "Constraints". This query is ultimately formed as an XML request sent to the WebDAV server. The response is also a generic "ResultSet" response, which consists of "Rows". Each Row consists of "Fields" (the same type as in the query). A Field is basically a key/value pair (all Strings), and a namespace which describes the location of the field within the WebDAV server. (obviously modelled on a JDBC-style interaction)
    I need to build a generic parser which can create a ResultSet from a raw XML document.
    For Example:
    Given a "query" with the following fields:
    FIELD 1
    namespace: urn:schemas:httpmail
    name:fromemail
    FIELD 2
    namespace: DAV
    name: id
    The query will basically say (pseudo SQL)
    "select "urn:schemas:httpmail:fromemail", "DAV:id" from <scope> where <constraints>"
    This will return an XML document something like this:
    <a:multistatus
          xmlns:a="DAV:"
          xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
          xmlns:c="xml:"
          xmlns:d="urn:schemas:httpmail:"
          xmlns:e="urn:schemas:mailheader:">
       <a:response>
          <a:href>
                http://blah.blah.com/someurl
          </a:href>
          <a:propstat>
             <a:status>
                   HTTP/1.1 200 OK
             </a:status>
             <a:prop>
                <d:fromemail>
                     [email protected]
                </d:fromemail>
                <a:id>
                      AQsAAAAARgAgCwAAAABGeAIAAAAA
                </a:id>
             </a:prop>
          </a:propstat>
       </a:response>
       <a:response>
       </a:response>
    </a:multistatus>
    So.. I then need to create a ResultSet object, which looks like this:
    ResultSet<Object>
    |---Rows<Collection>
        |---Row<Object>
            |---Field<Object>
                |---name: fromemail
                |---namespace: urn:schemas:httpmail
                |---value: [email protected]
            |---Field<Object>
                |---name: id
                |---namespace: DAV
                |---value: AQsAAAAARgAgCwAAAABGeAIAAAAA
        |---Row<Object>
                ....As you can see, I need BOTH the value, and the original data relating to the namespace and field name in the java object returned.
    Problems I am having:
    1. Parsing multiple namespaces. The path to multistatus/response/prop/fromemail (for example) spans two namespaces, hence can't use Commons Digester
    2. Including XML element names as values in the returned object. I need/want to be able to store the XML element name (eg "fromemail") as a value in the java object returned.
    I'm looking for thoughts as to the best way to deal with this... XPath?, DOM/SAX? etc
    Any help you can provide.
    Cheers

    Howdy all, here's my situation:
    I am attempting to create a simple interface to a particular type of webdav server which has some unusual XML data coming back, and need some advice on the best way to parse this XML.
    I have a generic "query" object which consists of a set of "Fields", a "Scope" and a set of "Constraints". This query is ultimately formed as an XML request sent to the WebDAV server. The response is also a generic "ResultSet" response, which consists of "Rows". Each Row consists of "Fields" (the same type as in the query). A Field is basically a key/value pair (all Strings), and a namespace which describes the location of the field within the WebDAV server. (obviously modelled on a JDBC-style interaction)
    I need to build a generic parser which can create a ResultSet from a raw XML document.
    For Example:
    Given a "query" with the following fields:
    FIELD 1
    namespace: urn:schemas:httpmail
    name:fromemail
    FIELD 2
    namespace: DAV
    name: id
    The query will basically say (pseudo SQL)
    "select "urn:schemas:httpmail:fromemail", "DAV:id" from <scope> where <constraints>"
    This will return an XML document something like this:
    <a:multistatus
          xmlns:a="DAV:"
          xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/"
          xmlns:c="xml:"
          xmlns:d="urn:schemas:httpmail:"
          xmlns:e="urn:schemas:mailheader:">
       <a:response>
          <a:href>
                http://blah.blah.com/someurl
          </a:href>
          <a:propstat>
             <a:status>
                   HTTP/1.1 200 OK
             </a:status>
             <a:prop>
                <d:fromemail>
                     [email protected]
                </d:fromemail>
                <a:id>
                      AQsAAAAARgAgCwAAAABGeAIAAAAA
                </a:id>
             </a:prop>
          </a:propstat>
       </a:response>
       <a:response>
       </a:response>
    </a:multistatus>
    So.. I then need to create a ResultSet object, which looks like this:
    ResultSet<Object>
    |---Rows<Collection>
        |---Row<Object>
            |---Field<Object>
                |---name: fromemail
                |---namespace: urn:schemas:httpmail
                |---value: [email protected]
            |---Field<Object>
                |---name: id
                |---namespace: DAV
                |---value: AQsAAAAARgAgCwAAAABGeAIAAAAA
        |---Row<Object>
                ....As you can see, I need BOTH the value, and the original data relating to the namespace and field name in the java object returned.
    Problems I am having:
    1. Parsing multiple namespaces. The path to multistatus/response/prop/fromemail (for example) spans two namespaces, hence can't use Commons Digester
    2. Including XML element names as values in the returned object. I need/want to be able to store the XML element name (eg "fromemail") as a value in the java object returned.
    I'm looking for thoughts as to the best way to deal with this... XPath?, DOM/SAX? etc
    Any help you can provide.
    Cheers

  • ATV not showing in the iTunes device list? Check your HTTP proxy config

    Seems like many people are having trouble getting their ATV to show up in the iTunes Devices list. Here's my situation, and the root cause:
    1. I have a small network at home consisting of one LAN with a number of computers, and a gateway router that provides DHCP, DNS and HTTP (web) proxy services
    2. I found that my ATV would display in the Devices list only when the ATV and at least one Mac were isolated from the rest of my network; when I connected them back to the rest of the LAN the ATV disappeared from the Devices list (in the simplest case this isolation was a crossover cable between the Mac and ATV)
    3. when connected to the whole LAN, the ATV could successfully contact the iTunes Store (trailers, etc) but would not show up in the Devices list
    4. I could ping the ATV from the Mac running iTunes every time (i.e. I did not have a basic connectivity problem; e.g. "ping appletv.local." always worked)
    5. I started with my ATV on v1.1, when I upgraded to 2.0 and turned on the the iTunes' "Look for remote speakers connected with AirTunes" option ATV always appeared in the speaker list (i.e. even when it wasn't in the Devices list)
    I had gone through the Apple troubleshooting guides, with no change.
    After a lot of elimination I discovered that my problem was with my web proxy settings: my Macs were configured to use my gateway router for HTTP, and it seems that iTunes connects back to the Apple TV via HTTP - these requests were sent to the proxy and rejected (as they were for an address on the inside LAN; this is the way my proxy was configured).
    I fixed the problem by using a PAC file specifying my LAN as "DIRECT" (e.g. below). An alternative would have been to configure my proxy to allow connections from the LAN back into the LAN (but be careful about allowing access from elsewhere, e.g. the Internet).
    Here's my PAC file: my LAN is in the 10.0.0.0/8 address space, domain *.home.lan. (iTunes seems to contact the AppleTV via it's IP address, e.g. http://10.0.0.169:3689/ript/fp-setup?fairPlayID=4a5...):
    function FindProxyForURL(url, host)
    // simple hostname
    if (dnsDomainLevels(host) == 0) {return "DIRECT";}
    // match Host against local domains (w/ optional :port)
    var dom = /(127\.\d.d+.d+|.local.?|10.d+.d+.d+|.home.lan.?)(:d)?/;
    if(dom.test(host)) { return "DIRECT"; }
    // All other requests go through port 8080 of proxy
    // should that fail to respond, go directly to the WWW:
    return "PROXY proxy.home.lan:8080; DIRECT";
    The reason the ATV was successfully appearing in the Devices list when it and a Mac were isolated from the rest of the LAN was that the Mac was unable to reach the proxy, and falling back to the 'DIRECT' connection.
    Note: if you don't have basic connectivity, e.g. if ping appletv.local. doesn't work, then the above is almost certainly not your problem.
    Ben
    Message was edited by: af3556

    Hi There,
    I have the exact same issue going on that this person described in this thread, but with the EXCEPTION in my case being that, after I have plugged my device into my laptop and uplugged it (about 10 consecutive times), my iTunes FINALLY recognizes my iPod Touch.
    This is extremely frustrating to have to go through this scenerio each and every single time I want to synch and charge my Touch. Is there any way to correct it, so that the device would be recognized immediately when I first plug it in? It used to work this way (prior to the v.10 update, most likely).
    Thanks!

  • Multiple receiver  agreement detection.

    Hi,
    Well i am developing a test application, which would be testing a system by sending a test idoc message from XI to the XI itself.
    1. A HTTP client is used to a idoc as a xml file to the SAP XI.
    2. Later the message is processed in the XI with the mappings etc & has to be transferred to a suitable receiver.
    3. In order to do the step 2, i need to determine whether the message is a test message or some other normal message. Hence in the Receiver determination, i need an appropriate condition.
    4. My problem is that i can search for a particular xml tag in the XPath of the test-idoc but i cannot determine whether its a normal message or not with an xpath expression. for example
    my condition for the test receiver determination:
    A)
    /Z_C_ADDADDRESS01/IDOC/EDI_DC40/SNDLAD = TestMessage_Tool
    B)
    /Z_C_ADDADDRESS01/IDOC/EDI_DC40/SNDLAD =/ TestMessage_Tool
    (=/ is not equals, i  have no other symbol here).
    The condition A is valid, but for a normal message B) has a problem. Since the tag SNDLAD does not exist at all in a normal message, it fails here. i also tried to check if there is anything like tag does not exist condition. but it is also not available.
    Has anybody done something similar to this before. if yes please do write back. if its necessary i shall elaborate more in detail.
    Thanks,
    Srinu.

    Hi Srinu,
    I was reading through the help on condition editor and saw this....
    EX Exists
    You use this operator to check the existence of the expression (in the left operand). This enables you to find out whether a substructure represented by the expression exists.
    You can use this operator if you want to check whether a particular element exists in the payload, for example. To do so, enter the element you want to check in the left-hand operand and leave the right-hand operand empty. <b>You can also use the = operand for this check.</b>
    I was thinking, it might be worth while giving a shot by using "not equals" and donot give anything in the right operand field....(as the "equals" with right operand blank check for "exists")...
    if you have already tries this....ignore my reply.
    btw..Welcome to SDN!
    Thanks,
    Renjith.

Maybe you are looking for

  • Getting href from button to third party cart to show correctly in Google Analytics

    Is there a trick to getting the button linked to third party shopping cart to appear correctly in Google Analytics? I need a special  href with an onclick attribute.  My third party gave the onclick code to me but it is more complicated than just sti

  • Sharing Limitations?

    Hi: Have searched the many "sharing a library" threads, but this covers slightly different ground: I'm not looking to let other users have any kind of Add To or Edit type access to a Shared library, but... I would like them to be able to search that

  • [APPLET][Heritage] Problem with classes

    Hi, I'm developping a simple JAVA Applet and I have a problem I have a class called LUIweb which is the main class. Here is a part of it. public class LUIweb extends JApplet implements Runnable { public void run() { DisplayMessage("JAVA rocks"); publ

  • Joining multiple tables across multiple data sources in MYSQL throws error

    Hi all, I have to join tables across multiples MYSQL databases eg : Table T1,T2 from DB1 Table T3 from DB2 Columns from T3 are aggregated ( dimensional column ). Hence when i query using oracle answers ( say i have columns from T1,T2 and T3 ) , OBIEE

  • Shared shows an unrecognized user on my network

    Hi there, I recently purchased my first Mac (Macbook Pro) running Leopard. I have a home network currently shared with a PC. In finder under "shared" it shows my PC and I can access the shared files there. But it also shows another user called "user3