XPath and XML parsers

Hi,
Does any API's provided in the new Java XML pack provide a way to get the XPath value for a particular node in a XML document!!!
thanks in advance!!

In addition to what lk555 says, you have to specify the position of the node with reference to its other siblings to specifically point to the node you are referring to.
if you have the following structure:
<root>
<child/>
<child/>
<child/>
</root>
The third child is obtained by /child[3], instead of just /child. The value 3 specifies its position.
Hope this helps

Similar Messages

  • XPAAJ and XML Parsers

    Does anyone know which XML parser is used by default in the XPAAJ API's.
    We are trying to compile an application into the Oracle Database. The solution then uses the internal Oracle JVM which strips out form data. However there appears to be a problem extracting xml data and we think its down to the Oracle XML parsers. Running the solution from the command line works as expected.
    Anyone have any ideas?
    Regards
    Kris

    In addition to what lk555 says, you have to specify the position of the node with reference to its other siblings to specifically point to the node you are referring to.
    if you have the following structure:
    <root>
    <child/>
    <child/>
    <child/>
    </root>
    The third child is obtained by /child[3], instead of just /child. The value 3 specifies its position.
    Hope this helps

  • Xpath and xml data queries

    I've got the xml found at:
    http://www.bankofcanada.ca/rss/fx/noon/fx-noon-all.xml.
    The xml looks like this(this is the US only one, but all the format and syntax is the same for the fx-noon-all.xml file):
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="http://purl.org/rss/1.0/"
    xmlns:cb="http://centralbanks.org/cb/1.0/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3c.org/1999/02/22-rdf-syntax-ns#rdf.xsd">
    <channel rdf:about="http://www.bankofcanada.ca/fx/daily_noon.html">
    <title>BoC noon rate: U.S. dollar</title>
    <link>http://www.bankofcanada.ca/fx/daily_noon.html</link>
    <description>Current day's noon foreign exchange rates from the Bank of Canada. Published at about 12:15 ET.</description>
    <items>
    <rdf:Seq>
    <rdf:li rdf:resource="http://www.bankofcanada.ca/rss/fx/noon/iexe0101.xml" />
    </rdf:Seq>
    </items>
    <dc:language>en</dc:language>
    <dc:date>2008-07-07</dc:date>
    </channel>
    <item rdf:about="http://www.bankofcanada.ca/rss/fx/noon/iexe0101.xml">
    <title>CA: 0.9830 USD = 1 CAD 2008-07-07 Bank of Canada noon rate</title>
    <link>http://www.bankofcanada.ca/fx/daily_noon.html</link>
    <description>1 Canadian Dollar = 0.9830 USD (USD = U.S. dollar). These are the Bank of Canada's nominal noon exchange rates, published at about 12:15 ET each business day. These are neither buying nor selling rates, and should be used for reference purposes only.</description>
    <dc:language>en</dc:language>
    <dc:date>2008-07-07</dc:date>
    <dc:format>text/html</dc:format>
    <cb:country>CA</cb:country>
    <cb:baseCurrency>CAD</cb:baseCurrency>
    <cb:targetCurrency>USD</cb:targetCurrency>
    <cb:value frequency="business" decimals="4">0.9830</cb:value>
    <cb:rateType>noon</cb:rateType>
    <cb:application>statistics</cb:application>
    </item>
    </rdf:RDF>
    I've inserted the xml into the CFS_XML_TABLE which has a column for the date
    and an XMLType column which holds the xml.
    I am trying to extract exchange rate data using a query like this:
    select extractValue(xml_data, '/RDF/item/title/text()') as "NodeVal"
    from cfs_xml_table;
    I'm just trying to get something out of it right now, but eventually I need to be able to get <cb:value>, <cb:baseCurrency> and <cb:targetCurrency>. Right now I can't even get the data in the title node...
    For the project I'm working on I have to use the Bank of Canada Feed.
    Does anyone have any ideas on what to do here?
    Thanks a lot,
    Devon

    I've never used namespaces with XPath before, but I happened to stumble across a solution that works by supplying a value for EXTRACTVALUE's "namespace_string" parameter (the third one).
    select
    extractvalue(
    xmltype(
    '<?xml version="1.0" encoding="ISO-8859-1"?>
    <rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="http://purl.org/rss/1.0/"
    xmlns:cb="http://centralbanks.org/cb/1.0/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3c.org/1999/02/22-rdf-syntax-ns#rdf.xsd">
    <channel rdf:about="http://www.bankofcanada.ca/fx/daily_noon.html">
    <title>BoC noon rate: U.S. dollar</title>
    <link>http://www.bankofcanada.ca/fx/daily_noon.html</link>
    <description>Current day''s noon foreign exchange rates from the Bank of Canada. Published at about 12:15 ET.</description>
    <items>
    <rdf:Seq>
    <rdf:li rdf:resource="http://www.bankofcanada.ca/rss/fx/noon/iexe0101.xml" />
    </rdf:Seq>
    </items>
    <dc:language>en</dc:language>
    <dc:date>2008-07-07</dc:date>
    </channel>
    <item rdf:about="http://www.bankofcanada.ca/rss/fx/noon/iexe0101.xml">
    <title>CA: 0.9830 USD = 1 CAD 2008-07-07 Bank of Canada noon rate</title>
    <link>http://www.bankofcanada.ca/fx/daily_noon.html</link>
    <description>1 Canadian Dollar = 0.9830 USD (USD = U.S. dollar). These are the Bank of Canada''s nominal noon exchange rates, published at about 12:15 ET each business day. These are neither buying nor selling rates, and should be used for reference purposes only.</description>
    <dc:language>en</dc:language>
    <dc:date>2008-07-07</dc:date>
    <dc:format>text/html</dc:format>
    <cb:country>CA</cb:country>
    <cb:baseCurrency>CAD</cb:baseCurrency>
    <cb:targetCurrency>USD</cb:targetCurrency>
    <cb:value frequency="business" decimals="4">0.9830</cb:value>
    <cb:rateType>noon</cb:rateType>
    <cb:application>statistics</cb:application>
    </item>
    </rdf:RDF>
    , '/rdf:RDF/item/title/text()'
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="http://purl.org/rss/1.0/"
    xmlns:cb="http://centralbanks.org/cb/1.0/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"
    ) as result
    from dual ;
    RESULT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    CA: 0.9830 USD = 1 CAD 2008-07-07 Bank of Canada noon rate        --
    Joe

  • XPath and XML

    I have an xml file
    <?xml version='1.0' encoding='UTF-8'?>
    <myBook>
    <friend>
    <name>Smith</name>
    <Address>NY</Address>
    <Birthday year='1976' month='12' day='23' />
    </friend>
    </myBook>
    Now I am writing a java application to access different Nodes of this xml file as per required. For example the query for a friend with birthday 09/22/76 will be
    //myBook/Birthday[@year = '76' and month = '09' and day = '22']
    and it works. But I am stuck with what if I want to get info of friends with birthdays between 06/23/78 and 09/16/78.
    Any ideas and help would be greatly appreciated.
    Thanx

    You can (and probably should) deal with this type of decision making using Java instead of XPath due to performance reasons. However, if you must deal with it using XPath, here is a sample.
    Assume that you have the following XML document fragment:
    <myBook>
    <friend>
    <name>Smith</name>
    <Birthday year='1976' month='06' day='15' />
    </friend>
    <friend>
    <name>Joe</name>
    <Birthday year='1976' month='06' day='23' />
    </friend>
    <friend>
    <name>Bill</name>
    <Birthday year='1976' month='09' day='15' />
    </friend>
    <friend>
    <name>Bill</name>
    <Birthday year='1976' month='09' day='21' />
    </friend>
    </myBook>
    The following XPath query will return the nodes that contains friend nodes where the month is between 6 and 9.
    XPath:
    //friend/Birthday[(@month>'5')][(@month <'10')]/parent::*
    Result:
    <friend>
         <name>Smith</name>
         <Birthday year="1976" month="06" day="15" />
    </friend>
    <friend>
         <name>Joe</name>
         <Birthday year="1976" month="06" day="23" />
    </friend>
    <friend>
         <name>Bill</name>
         <Birthday year="1976" month="09" day="15" />
    </friend>
    <friend>
         <name>Bill</name>
         <Birthday year="1976" month="09" day="21" />
    </friend>
    Then you have to look at each returned node and decide whether to accept it or reject.
    Note: You have to use & to escape "<" and ">" in the XPath as the comparison operator

  • Personalization Server And  XML Parsers

    hello there,
    I am a new user of Weblogic commerce suite 2.0.
    WE want to develop a portal by using above mentioned S/W. We want to get news from Reuters(which is XML data) and want to show it on our page. For this purpose do we need a XML parser or WLCS has in built support for this ????
    Regards
    abhishek d

    You can mix CMP and BMP beans. You could deploy the various
    personalization server related beans as bmp and then use CMP for the
    components.
    Jeff Wang
    WLCS 2.0 Software Engineer
    helder alexandre wrote:
    >
    Hi,
    What I would like to do is the deployment with MS SQL Server with cmp.
    But I think it isn't possible because for the personalization server there isn't
    the -bmp- version of the jars, if you check the weblogic-cmp.properties and
    weblogic-bmp.properties for the personalization server are deployed the same
    jars.
    I've made some research and find out that the jars are the same and that the
    beans of usermanagemet are always bmp.
    Thanks.
    Helder
    Mike Horn wrote:
    there should be an oracle script in welogiccommerce\db\oracle that you can
    use to create the database; then set your deployment set to BMP and make
    sure that the ejb jars that you deploy are the -bmp- version
    "helder alexandre" <[email protected]> wrote in message
    news:[email protected]..
    I will follow this question in w.d.interest.commerce.
    But the same applies to MS SQL Server, because we have a driver jdbc forthat
    dmbs ?
    Thank You.
    Helder
    Jeff Wang wrote:
    repeated from a post I made on tuesday in the w.d.interest.commerce
    newsgroup:
    I would suspect that the easiest way to do CMP in oracle is to take the
    Cloudscape SQL file, and change all the serialized data types to
    BLOBs... Not having personally done it, I don't know how painful it is
    to do, but CMP should work relatively fine. Of course, if you have your
    own data-mapping, that would be great too. There's nothing stopping you
    from doing CMP on Oracle, other than the data schema, that is...
    Jeff Wang
    WLCS 2.0 Software Engineer
    helder alexandre wrote:
    Hi,
    Have someone tried to install the Personalization Server with
    container
    managed persistence (cmp) in another DB than Cloudscape ??? Can the
    Personalization Server be installed with Oracle and cmp ?
    And for instance MS SQL Server ?
    Thanks in advance,
    Helder

  • Experiences with Adobe XPAAJ, XML Parsers, OC4J /AS 10.1.2,10.1.3 and DB10g

    Over the past couple of weeks we have been working on a solution which uses the newly available adobe XPAAJ api's (XML/PDF Access API for Java) for Java.
    The client has a legacy requirement to where users are issued with a pdf form which they complete, save and upload to the server via a JSP. A neat bit of Java code utilizing the XPAAJ API's then strips out the form entered data and spits out XML. This is then parsed and inserted into relational tables within the schema.
    Our solution needs to be deployed to an Oracle stack. However we ran into a number of problems when deploying the solution to AS 10.1.2. The adobe API's are not compatible with the Oracle XML Parsers. When extracting the form data, no error is reported and the code which performs the xml parsing just fails. Very nasty.
    The main problem has been that Oracle XDK libraries have been hard-coded into the classpath of the container using the referential JAR file Class-Path mechanism. Altering this has required the use of the JRE extension library mechanism, or altering the boot classpath of the JVM when it is launched to load the alternative XML parser implementation instead. While this works, it has been an unsupported operation since the effect of this change is not limited to a specific application – it’s effect are felt across the entire container and this may lead to unpredictable results at runtime.
    ~http://www.oracle.com/technology/tech/java/oc4j/10131/how_to/how-to-swapxmlparser/doc/readme.html
    We did look at a number of other solutions including embedding the java classes I'd written into the database. After loading the apache Xerces api's into our schema we hit upon the same problem. It seems that the same thing happens in the database and the Oracle XML parser is used by default.. Please see SR Number : 6153038.994 on Metalink.
    If you can upgrade to AS 10.1.3 then you can follow the excellent how to at:http://www.oracle.com/technology/tech/java/oc4j/10131/how_to/how-to-swapxmlparser/doc/readme.html . Demo code can be found at: http://www.oracle.com/technology/tech/java/oc4j/10131/how_to/how-to-swapxmlparser/how-to-swapxmlparser.zip
    The how-to details how to swap xml parsers within the application server.
    Other possible solutions that are also available include:
    - Shelling out to the OS from the DB or Apps Server, You can then execute the app as a command line app with a custom classpath. Very bad architecture design.
    - Setting up an RMI client / server application where client is the db or apps server. You can find examples of this on the web. google 'Simple RMI example'.
    - Bootstrapping the XML parser in AS 10.1.2 (unsupported).
    I hope people have found this informative. It might save someone a lot of time.
    Message was edited by:
    Kris Jones

    "When I was installing SOA 10.1.3.1.0 on oracle 10.2.0.1 and it was giving error that it needs minimum 10.2.0.3, just wondering 10.1.2.0.2 + SOA =will this work?"
    so you talk about the db version. SOA 10.1.3.x runs on 10.2.0.1 and above (I ran for the longest time on XE) and if I remember correctly that's a warning, and not a hard prereq.
    Regarding Appserver versions - soa 10.1.3 runs on AS 10.1.3 only

  • Xpath and Get XML Document Data

    Good Morning,
    I have just recently gotten involved in a project that requires communicating with some web services (axis2). We have existing scripts that handle this already, but they were built when we weren't on axis2 so now the XML output from the web service call is slightly different and i am no longer able to use the same xpath statement in the Get XML Document Data step.
    I am receiving either null values or a prefix namespace error. I am new to xpath and have been reading as best i can from http://www.w3schools.com/xpath/ to try and understand how to write my statements to pull out the data i want correctly.
    I have read that sometimes the editor has problems if the XML contains namespace declarations, etc.
    Below is an example XML output where I'd like to be able to read the value in the ax211:success. My xpath gets prefix namespace errors as it doesn't recognize ax211.
    Xpath: /descendant::ns:validateCertificationResponse/child::ns:return/child::ax211:success
    Perhaps my xpath statement is just incorrect and wouldn't retrieve what i expect it to....
    Any advice is appreciated.
    Thanks,
    Kevin

    Hi,
    well, it appears that text() is automatically appended to the XPath query for some reason in UCCX, this is why you actually see the text node within the ax211:success element. This //*[local-name()="success"] select the whole node, not its first child (which is actually the first element, which also happens to be a text).
    Anyway,
    // - anywhere
    * - any node
    And within this "everything" you actually search with the condition within the angular brackets.
    G.

  • Help needed with Java 1.4 and xml Runtime problem

    I am working on a java 1.3 and JAXP1.1 written code. Now I want to compile and run it using J2SE 1.4. Here are the import statements from the existing code.
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.Locator;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.XMLReader;
    import org.xml.sax.InputSource;
    import java.sql.*;
    import java.net.*;
    import java.io.*;
    When I run the existing(using java 1.3 and Jaxp1.1) code I have to include the files crimson.jar and jaxp.jar in the windows 2000 CLASSPATH and works fine.
    But when I compile and run it using J2SE 1.4 which has the built in support for the saxp, I thought that I don't have to specify any CLASSPATH for the new 1.4 so I don't specify any Classpath and it gives me the Microsoft "ClassFactory cannot find the requested class" error which means that even thought the new java 1.4 has the xml classes as libraries yet it still requies some .jar files to be listed in the CLASSPATH.
    If I am right then what path will work(i.e what jar class I need to add to the CLASSPATH).
    Thanks for your help.
    RA.

    Thanks for your reply,
    I think I didn't specify when the error occurs. The ClassFactory related error occurs when I run the program, it compiles without any error.
    From what I understood somewhere in the java 1.4 docs, that the new 1.4 has the xml libraries built in by default so one doesn't need to give the classpaths just like we don't give any CLASSPATH for using swing and many of the other java packages. That is one thing.
    Second thing is that I also tried to use the java_xml_pack-spring02 and java_xml_pack-summer02; but non of them include the crimson.jar and the jaxp.jar files in them which are the 2 .jar files that makes the program run fine when used under the java 1.3 with combination of the jaxp1.1(which was downloaded seperately and then the CLASSPATH for it was set.).
    Can you please help what .jar files do I need to use instead. I tried to use the ones that the new java_xml_pack-spring02 and java_xml_pack-summer02 has for the jaxp in them.
    Thanks again.
    RA

  • Weblogic 12g Server - EAR with WAR - how can I have different XML parsers

    Hi All,
    I have a requirement where I need to have two different XML parsers in the same enterprise application.
    By backend Spring container require a XML parser and my JSP code which has XSLT logic require another XML parser.
    If I specify -D System property then it is applied to the whole Enterprise application. Instead I want a way to specify different XML parsers one for Spring backend container and the other for JSP pages.
    I am deploying my application in Weblogic and it is an EAR file.
    Thanks in Advance,
    Kishore Veleti A.V.K.

    check this one.
    -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl

  • Try to do my first XML Schema in SQL Server 2012 Mangement Studio(SSMS2012)-How to execute the xsd and xml files in SSMS2012?

    Hi all,
    I learmed the basic stuff of XML, DTD, DOM, etc. long time ago. Now, I came back to resume my XML journey and try to learn the XML Schemas, XPath and XQuery. I have Microsoft SQL Server 2012 Management Studio (SSMS2012) in our computer network. From
    Page 221 of the old Book "Beginning XML 2nd Edition" written by David Hunter, et.al., (published by Wrox), I copied the name5.xsd and name5.xml :
    <?xml version="1.0"?>
    <schema xmlns=http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.wrox.com/name" xmlns:target="http://www.wrox.com/name"
    elementFormDefault="qualified">
    <element name="name">
    <complexType>
    <sequence>
    <element name="first" type="string"/>
    <element name="middle" type="string"/>
    <element name="last" type="string"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    <?xml version="1.0"?>
    <name
    xmlns=http://www.wrox.com/name"
    xmlns:xsi="http://www.wrox.org/2001XMLSchema-instance"
    xsi:schemaLocation="http://www.wrox.com/name name5.xsd"
    title="Mr.">
    <first>John</first>
    <middle>Frizgerald</middle>
    <last>Doe</last>
    </name>
    How can I execute these two files in my SSMS2012 for doing my first XML Schema trial?
    Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hi Eric Zhang, Thanks for your nice response.
    1) I saw the CREATE XML SCHEMA COLLECTION (Transact-SQL) and tried  its first example "Create XML schema collection in the database" in my SQL Server 2012 Management Studio (SSMS2012):
    -- Create a sample database in which to load the XML schema collection.
    -- Copied this set of code stsments from Microsoft Library (ms176009)
    -- ColesMS12_20a.sql (saved in C:/Documents/SQL Server Management Studio)
    -- 19 March 2015 1145 AM
    CREATE DATABASE SampleDB
    GO
    USE SampleDB
    GO
    CREATE XML SCHEMA COLLECTION ManuInstructionsSchemaCollection AS
    N'<?xml version="1.0" encoding="UTF-16"?>
    <xsd:schema targetNamespace="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"
    xmlns ="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
    <xsd:complexType name="StepType" mixed="true" >
    <xsd:choice minOccurs="0" maxOccurs="unbounded" >
    <xsd:element name="tool" type="xsd:string" />
    <xsd:element name="material" type="xsd:string" />
    <xsd:element name="blueprint" type="xsd:string" />
    <xsd:element name="specs" type="xsd:string" />
    <xsd:element name="diag" type="xsd:string" />
    </xsd:choice>
    </xsd:complexType>
    <xsd:element name="root">
    <xsd:complexType mixed="true">
    <xsd:sequence>
    <xsd:element name="Location" minOccurs="1" maxOccurs="unbounded">
    <xsd:complexType mixed="true">
    <xsd:sequence>
    <xsd:element name="step" type="StepType" minOccurs="1" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:attribute name="LocationID" type="xsd:integer" use="required"/>
    <xsd:attribute name="SetupHours" type="xsd:decimal" use="optional"/>
    <xsd:attribute name="MachineHours" type="xsd:decimal" use="optional"/>
    <xsd:attribute name="LaborHours" type="xsd:decimal" use="optional"/>
    <xsd:attribute name="LotSize" type="xsd:decimal" use="optional"/>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>' ;
    GO
    -- Verify - list of collections in the database.
    select *
    from sys.xml_schema_collections
    -- Verify - list of namespaces in the database.
    select name
    from sys.xml_schema_namespaces
    -- Use it. Create a typed xml variable. Note collection name specified.
    DECLARE @x xml (ManuInstructionsSchemaCollection)
    GO
    --Or create a typed xml column.
    CREATE TABLE T (
    i int primary key,
    x xml (ManuInstructionsSchemaCollection))
    GO
    -- ////The following code statements are not used in order to create SampleDB
    -- Clean up
    ---DROP TABLE T
    ---GO
    ---DROP XML SCHEMA COLLECTION ManuInstructionsSchemaCollection
    ---Go
    ---USE Master
    ---GO
    ---DROP DATABASE SampleDB
    It worked and I got the following results:
    1 4 NULL sys 2009-04-13 12:59:13.390 2012-02-10 20:16:02.097
    65536 1 NULL ManuInstructionsSchemaCollection 2015-03-19 11:47:17.660 2015-03-19 11:47:17.660
    http://www.w3.org/2001/XMLSchema
    http://schemas.microsoft.com/sqlserver/2004/sqltypes
    http://www.w3.org/XML/1998/namespace
    http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions
    But, I don't undertand (i) what SCHEMA COECTION is, (ii) what <xsd:schema targetNamespace=.....</xsd:complexType> are, (iii) How I can specify my "project specific" schema in the Microsoft SCHEMA COLLECTION to check my xml file.
    2) I dived in the XQuery programmimng in SSMS2012 in the last few weeks. I used the examles of Ad-Hoc XML File Query by Seth Delconte (in
    httpS://www.simple-talk.com/content/print.aspx?article=1756) in my SSMS2012. They worked. But I don't understand the (i) Importing XML data using a function, (ii) Using the XQuery contans()
    function to find substrings, (iii)Efficiency comparisons in the article.
    Please kindly help me in enlightening me to resolve the difficulties listed in 1) and 2).
    Thanks,
    Scott Chang

  • Exception with javax.xml.parsers.FactoryConfigurationError

    I have a code segment that is working in a Java standalone application environment. I've taken the same segment and ran it in Lotus Domino's environment, with the following error,
    javax.xml.parsers.FactoryConfigurationError: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    Can anyone help?

    I changed a switch within the Lotus Domino environment to allow class loader, but now I'm getting a different error,
    javax.xml.parsers.FactoryConfigurationError: Provider org.apache.crimson.jaxp.DocumentBuilderFactoryImpl not found
    Any idea?

  • Package javax.xml.parsers does not exist

    When I compile the sample program for xml, DOMEcho.java, or any other xml java program, I get errors on the import statements.
    For all the import statements within java.xml.* I get an error message such as: package javax.xml.parsers does not exist.
    I have my path and classpath variables set as follows.
    REM Java initialization
    SET PATH=c:\Documents and settings\User\jwsdp-1_0_01\bin;c:\j2sdkee1.3.1\bin;c:\jdk1.3.1_01\bin;%PATH%
    SET JAVA_HOME=c:\j2sdkee1.3.1_01
    SET JAVA_XML_PACK_HOME=c:\java_xml
    SET JAXM_HOME=c:\java_xml\java_xml_pack-summer-02_01\jaxm-1.1_01
    SET JAXP_HOME=c:\java_xml\java_xml_pack-summer-02_01\jaxp-1.2_01
    SET JAXR_HOME=c:\java_xml\java_xml_pack-summer-02_01\jaxr-1.0_02
    SET JAXRPC_HOME=c:\java_xml\java_xml_pack-summer-02_01\jaxrpc-1.0_01
    SET CLASSPATH=c:\Documents and settings\User\jwsdp-1_0_01\bin;c:\Documents and settings\User\jwsdp-1_0_01
    SET CLASSPATH=%CLASSPATH%;c:\jdk1.3.1_01\bin;c:\jdk1.3.1;
    SET CLASSPATH=%CLASSPATH%;c:\java_xml\java_xml_pack-summer-02_01\jaxm-1.1_01;
    SET CLASSPATH=%CLASSPATH%;c:\java_xml\java_xml_pack-summer-02_01\jaxp-1.2_01;
    SET CLASSPATH=%CLASSPATH%;c:\java_xml\java_xml_pack-summer-02_01\jaxr-1.0_02;
    SET CLASSPATH=%CLASSPATH%;c:\java_xml\java_xml_pack-summer-02_01\jaxrpc-1.0_01
    Any ideas?

    Now that the first program compiled I tried another sample program:
    StandAlone.java and
    got the same errors.
    * $Id: StandAlone.java,v 1.10 2002/04/06 00:47:31 mode Exp $
    * $Revision: 1.10 $
    * $Date: 2002/04/06 00:47:31 $
    * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
    * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    This program starts with...
    import java.io.*;
    import javax.xml.soap.*;
    import java.net.URL;
    import javax.mail.internet.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    import org.dom4j.*;
    * A StandAlone JAXM Client.
    public class StandAlone {

  • Combine query and xml recordset

    I'm trying to see what's the best way to combine a query and
    XML recordset.
    Database:
    TableA
    FieldA, FieldB, ...
    Joe, 1
    Bob, 2
    XML from Web Service
    <record id="1" att="Job A" .../>
    <record id="2" att="Job B" .../>
    Need to link TableA.fieldB to matching id attribute from the
    XML recordset.
    Right now, I load theXML recordset along side the query and
    use XPath to search the XML based on parameters from the query that
    I'm looping and output the results to screen.
    <cfloop ...>
    xmlStr = xmlSearch(xmlRecordset,"/root/record[id =
    #qry.fieldB#]");
    <tr><td>qry.fieldA</td><td>xmlStr</td></tr>
    </cfloop>
    Just wondering to see if it's good to do it like this.

    Might be faster to convert the xml to a query and then use
    query of queries with a join statement.

  • XPath and oracle parser

    Hi,
    I am using Oracle parser to parse my XML file, as i found that it is faster then IBM and sun parser, But i think it does not support XPath, so how can i use XPath and oracle parser, I can also use Sun parser , but dont know if it has XPath support,
    So please help me out

    I suppose it supports DOM or a saxHandler that can provides you a DOM
    tree. For Xpath, may I suggest you my solution : http://www.japisoft.com/jxpath
    Regards,
    A.brillant

  • XPath and XQuery

    Hi all,
    What's the difference between the XPath and XQuery, can XPath has better performance than XQuery?
    Regards,
    Jane

    shree wrote:
    1.Can you differentiate these XSLT, XPath and XQuery.XSL stands for EXtensible Stylesheet Language, and is a style sheet language for XML documents. XSLT stands for XSL Transformations.
    XQuery is to XML what SQL is to database tables. XQuery was designed to query XML data.
    XPath is used to navigate through elements and attributes in an XML document. XPath is a major element in W3C's XSLT standard - and XQuery and XPointer are both built on XPath expressions.
    http://www.w3schools.com/xsl/default.asp
    http://www.w3schools.com/xquery/default.asp
    http://www.w3schools.com/xpath/default.asp
    Cheers,
    Vlad

Maybe you are looking for