Namespace and the DOM Parser

I have an XML file that has an explicit DTD that I am putting
through the DOMSample with Validation set to true and it works.
If I then introduce a section with a namespace reference I find
the parser throws out errors.
Do I have to tell it that namespaces are being used? if so how?
Do I have to use namespace through out and not use the DOCTYPE
tag?
Please help.
Also I have scouted around the documentation and find the stuff
on line woul dbe far more useful with some good examples, please?
Martin Roberts
null

Attachments: "1|type=text/xml|desc=XML file |1908|file=MegaStream.xml|"
I have found and tried to use the DOMnamespace example in the
sample downloaded. It works fine, except that it will not
validate the document.
Is this a problem with the parser not understanding the xmlns
attribute?
Also is there an option to be able to get the parser to expand
the default values defined in the dtd attribute definitions.
If you run IE5 you get the attributes expanded.
null

Similar Messages

  • Sorting xml with the dom parser

    Hello,
    Does the DOM parser have any inbuilt soring methods?

    I'm not sure what you are looking for. XSL has sort keys on xsl:apply-templates or xsl:for-each
    Paul
    www.codetelligence.com

  • [svn:osmf:] 14357: Moved constants for namespace ( also added a version number to the namespace) and the metadata key to the MASTPluginInfo class so these constants can be used from player code .

    Revision: 14357
    Revision: 14357
    Author:   [email protected]
    Date:     2010-02-23 09:41:57 -0800 (Tue, 23 Feb 2010)
    Log Message:
    Moved constants for namespace (also added a version number to the namespace) and the metadata key to the MASTPluginInfo class so these constants can be used from player code.
    Modified Paths:
        osmf/trunk/plugins/MASTPlugin/org/osmf/mast/MASTPluginInfo.as
        osmf/trunk/plugins/MASTPlugin/org/osmf/mast/media/MASTProxyElement.as

    Revision: 14357
    Revision: 14357
    Author:   [email protected]
    Date:     2010-02-23 09:41:57 -0800 (Tue, 23 Feb 2010)
    Log Message:
    Moved constants for namespace (also added a version number to the namespace) and the metadata key to the MASTPluginInfo class so these constants can be used from player code.
    Modified Paths:
        osmf/trunk/plugins/MASTPlugin/org/osmf/mast/MASTPluginInfo.as
        osmf/trunk/plugins/MASTPlugin/org/osmf/mast/media/MASTProxyElement.as

  • XPATH and the C parser

    Can I use an 'XPATH' expression to find a node using the C parser?
    eg find '/A/B/C'
    The Oracle Java parser supports this.
    Thanks for your help.
    Doug

    Yes, we have Xpath and XSLT support in the parser.

  • Problem in parsing a xml string using dom parser

    i want to parse a Xml String using a Dom parser......the parse function in dom parser takes only input stream as argument.......so i made the code as
    InputStream inputstream = new StringBufferInputStream(XmlData) ;
    InputSource inputSource = new InputSource(inputstream );
    but saxexception is coming and also warning called
    "java.io.StringBufferInputStream in java.io has been deprecated"
    please help me.........

    i want to parse a Xml String using a Dom
    parser......the parse function in dom parser takes
    only input stream as argument.......This is not true of the DOM parser in Java 1.4. So you might want to get rid of your old parser and replace it by something more current. Or perhaps you are using 1.4 and you just didn't read all of the API docs.

  • JmsAdapter DOM Parsing Exception handling

    Hi,
    I'm currently facing a problem with the behaviour of the Jms Adapter.
    Whenever a JMS message is put in the queue and that message is not XML valid, the Jms Adapter (consumer) throw the exception "DOM Parsing Exception in translator Exception".
    That's fine, I understand that the message was not well formed. But what is not fine is that the underlying BPEL is not instanciated : meaning I can't handle the exception properly.
    Is there a way to force the Jms Adapter not to crash on the DOM Parsing for the BPEL to be instanciated (and then being able to handle the exception there) ?
    Or is there a way to handle the error thrown by the Jms Adapter itself ? How ?
    I think I do have a workaround to this if there is no better option (if both above questions cannot be answered) but I would rather not implement it since it will involve some extra steps / complexity.
    > It would be to check the "native format opaque schema" option and then use a java embedded to decode the base64 into a string for eventually parsing it.
    regards,
    mathieu

    Hi Mathieu,
    The messages that error out before being posted to the service infrastructure are referred to as rejected messages. For example, the Oracle File Adapter selects a file having data in CSV format and tries to translate it to XML format (using NXSD). If there is any error in the translation, this message is rejected and are not be posted to the target composite.
    You can create rejection handlers to handle message errors. Message errors include those that occur during translation, correlation ID mismatch and XML parsing after message reception.
    Docs on how to do that are here...
    http://docs.oracle.com/cd/E28280_01/integration.1111/e10231/life_cycle.htm#CIAIICJJ
    Cheers,
    Vlad

  • DOM Parsing Not working in Applet.

    Hi,
    I ve an applet (parserapplet)which contains the DOM parsing. So xalan.jar(nearly 780 kb) required to assist the parsing. I gave archive="xalan.jar" in My html file. But the jar file is not downloaded from the archive tag. and ClassnotFoundException is thrown.
    the exact exception is:
    ======================
    com.ms.security.SecurityExceptionEx[Host]: cannot access file C:\WINNT\Java\lib\jaxp.properties
         at com/ms/security/permissions/FileIOPermission.check
         at com/ms/security/PolicyEngine.deepCheck
         at com/ms/security/PolicyEngine.checkPermission
         at com/ms/security/StandardSecurityManager.chk
         at com/ms/security/StandardSecurityManager.checkRead
         at java/io/File.exists
         at javax/xml/parsers/DocumentBuilderFactory.findFactory
         at javax/xml/parsers/DocumentBuilderFactory.newInstance
         at parserapplet.parseXMLMessage
         at parserapplet.init
         at com/ms/applet/AppletPanel.securedCall0
         at com/ms/applet/AppletPanel.securedCall
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    javax.xml.parsers.FactoryConfigurationError: java.lang.ClassNotFoundException: org/apache/crimson/jaxp/DocumentBuilderFactoryImpl
         at javax/xml/parsers/DocumentBuilderFactory.newInstance
         at parserapplet.parseXMLMessage
         at parserapplet.init
         at com/ms/applet/AppletPanel.securedCall0
         at com/ms/applet/AppletPanel.securedCall
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    I know signing the applet a bit. But though it is signed , second exception is constantly thrown. so please write in detail the procedure to sign the applet. and how to download xalan.jar in html page etc.,
    I require how to download the jar files, and after the completion of downloading of the jar files only, the applet should get executed. or shall i use different jar file(like crimson.jar?). This is urgent requirement.Please help me.!
    the classes for the parsing are not at all downloaded and hence the problem.
    help me reg that.
    thank you in advance/.
    Prasanna kumar k.

    Hello Prasanna kumar k.
    First you should sign your jar files (xerces.jar crimson.jar and xalan.jar) and recreate a cab files
    xerces.cab crimson.cab xalan.cab. To do that you should download sdk for java from microsoft .
    create testkey named testkey.pvk
    1. makecert -sv testkey.pvk -n "CN=your name" test.cer
    convert to public key
    2. cert2spc test.cer test.spc :
    create cab file
    3. cabarc -p -c -r -s 6144 test.cab
    sign the cab file
    4. signcode -j java.dll -jp -low -spc -v testkey.pvk -n test.cab
    after that you should use thia files in html:
    <!doctype html public "//W3//DID HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <META content="text/html; charset=iso-8859-1">
    <TITLE>IBM Host On-Demand 6.0</TITLE>
    </HEAD>
    <BODY BACKGROUND="mankolpr/custom/img/Drawing1.gif">
    <CENTER>
    <IMG src="mankolpr/custom/img/images/ot_hod_log.gif">
    <P>
    <APPLET archive="crimson.jar,xerces.jar,xalan.jar" CODE="test.class" WIDTH=584 HEIGHT=450>
    <PARAM NAME=cabinets VALUE=crimson.cab,xerces.cab,xalan.cab>
    <PARAM NAME=background VALUE="pink">
    <p>If you are reading this message, your client platform is not capable of running
    IBM Host On-Demand. To run IBM Host On-Demand, you must have a Java-enabled web
    browser such as Netscape Navigator or Microsoft Internet Explorer.
    </APPLET>
    </CENTER>
    </BODY>
    </HTML>
    Best Regards,
    Tzur Emzari
    Project Manager
    Local Authority Data Processing Center LTD
    ISRAEL
    Tel : 972-4-8615754, Fax : 972-4-8661977
    Cell : 972-53-532448
    [email protected] <mailto:[email protected]>

  • Using the SAX parser to split up a document to be processed by a DOMParser

    I need to process a potentially large document which could prove too large to be read into memory at once by the DOM parser. The document would look something like..
    (sorry about the formatting - can't use tabs!)
    <Root>
    <Parent>
    <Child>
    <Blah.....................
    </Blah>
    </Child>
    </Parent>
    <Parent>
    <Child.......
    </Child>
    </Parent>
    etc...
    etc...
    </Root>
    The number of Parent elements could potentially be in the thousands. What I would like to do would be to use the SAX parser to read the document and when a Parent element is encountered, write the parent element and all its children to a stream in order that an input source can be created. The input source can then be parsed by a DOM parser. Once complete, the next Parent element encountered by the SAX parser could be passed to the DOM parser and so on until all of the Parent elements have been processed.
    This way I can combine the ease of parsing the document using the DOM parser without having to worry about the overhead on memory.
    Does anyone have any ideas as to the best approach? I could use the SAX parser for the whole thing but the XML is quite complex and lends itself to DOM parsing much more conveniently.

    Can you read the file line by line:
    start the reading at <child>
    pause reading at </child>
    copy the string to a var
    wrap it with respective tags (<?xml<doctype etc...) and parse
    proceed to the next <child>xx</child>
    and repeat till you hit the closing of the file...
    - Ravi

  • Vc webdynpro DOM parsing

    hello there
    i tryed the DOM parsing on the returned paramter from the <u>portal eventing</u>
    between<u> visual composer and webdynpro</u> and i get this error :
    <b>com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here:
    (hex) 25, 33, 43(:main:,row:1,col:3</b>
    the ascii code from the visual composer in dataObject is:
    %3CParamas%20version%3D%222%22%20%3E%3CRow%20STR1%3D%22test1%22%20/%3E%3C/Params%3E
    the xml code of dataObject string is:
    <b><Params version="2"><Row STR1="test1"\><\Params></b>
    the java code is:
    // Create a Dom parser
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    DocumentBuilder docBuilder = factory.newDocumentBuilder();
    // Parse input to create document tree
    StringReader s = new StringReader(dataObject);
    InputSource is = new InputSource(s);
    Document doc = docBuilder.parse(is);

    thanx but i fixed the problem my self the problem was in visual composer out put xml its sent a '/' insted of '\' in the xml syntax

  • NonValidating DOM Parser & Whitespace text nodes

    Hello,
    Using the DOM parser and the Oracle samples (DOMSample),I wrote a
    java progam to filter an XML file.
    Ex:<a>
    1
    <c>2</c>
    </a>
    to
    a:
    b:1
    c:2
    end
    It works fine. But when I set the parsers validation mode to
    false, my code fails. It seems that a TEXTNODE is now generated
    containing the whitespace of the file as I traverse the DOM tree.
    Should I code around this or is there another way to handle
    this unexpected textnode?
    Bob
    null

    Correct me if i am wrong.
    The Element object you are referring to is of type
    org.w3c.dom.Element.
    And as far as i know, it doesn't have any methods
    such as getTextContent().Even the Node class does not
    have such method.Yes you are wrong , with JDK 1.5 they do have getTextContent() method for org.w3c.dom Node & Element .
    @ OP , dont know why your getTextContent is not working its working over here for me .
    You may iterate over such a Node and remove the contents.
    for. eg.
    <Name>Son</Name>
    Node name //(is ur node )
    NodeList nk = node.getChildNodes();
                              String val= null;
                              for (int j=0; j < nk.getLength(); j++) {
                                Node k = nk.item(j);
                                val=  k.getNodeValue();
                              }Now u may use the value collected in String val
    but make sure u apply this code only to above type of node, viz <Name>Son</Name>

  • How to read xml-stylesheet Processing Instruction from XML using DOM Parser

    Hi,
    I am trying to read an xml that contains xsl stylesheet PI using DOMParser. The parse() method reads the entire contents of the XML except the PI instruction. Below is the XML I am using to read
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet href="../../../lang/en-us/style0/usc_profile.xsl" type="text/xsl"?>
    <Oblix oblang="en-us" xmlns="http://www.oblix.com/" xmlns:oblix="http://www.oblix.com/">
    <ObProfile>
    </ObProfile>
    </Oblix>
    Can anyone let me know if there are any propery settings to be done for the DOM parser before parsing?. If so, what is the property to be set?.
    Thanks in Advance
    Muthu

    A COTS product builds the XML and inserts the respective xsl (xml:stylesheet) file name to be used for transforming the xml. I am trying to interrupt this xml and make some updations on an element and finally send the updated xml to the stream.
    For the above process, I parse the input XML using DOMParser and update the elements (some internal elements). While I view the final XML that would be passed to the stream, I found the <?xml-stylesheet... PI is missing.
    I somehow managed using a temp fix by doing the below. I manually pulled the PI using document.getFirstChild().getNodeValue() and reconstructed the PI and inserted it to the outgoing XML. This needs to be done every time. This might run into problems when more than one PI is used in the XML.
    If the parsed XML could get the PI along with it the above problem could be resolved.
    Is there any property that could be set on the parser (prior to parsing) to resolve the issue?.

  • Delete namespace and prefix with Seeburger X.400 receiver

    Dear experts,
    I have a problem deleting a namespace and prefixes "ns0" from an XML output. When testing I was using an FTP receiver adapter with the AnonymizerBean which worked perfectly. I referred to: /people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean
    Now I have a Seeburger X.400 receiver adapter and the AnonymizerBean does not work anymore.
    The output message looks like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:ORDERRESPONSE xmlns:ns0="http://www.opentrans.org/XMLSchema/1.0" version="1.0">
    <ns0:ORDERRESPONSE_HEADER>
    <ns0:ORDERRESPONSE_INFO>
    <ns0:ORDER_ID>xxxxx</ns0:ORDER_ID>
    So I need to get rid of the namespace and the prefixes "ns0". Does anyone know how to configure the module of the X.400 receiver adapter to do this?
    Thank you very much for your help!
    Best regards,
    Peter

    Hey Guys,
    I am having issues with using anonymizer bean. Below is the data with namespaces I would like to strip:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:ExecuteXMLRequest xmlns:ns1="http://decisionintellect.com/inteport/">
    - <ns1:_sRequestXML>
    - <ns1:inteflow>
    - <ns1:request cd_type="submit">
    - <ns1:user>
      <ns1:id_oper>INTERFACE</ns1:id_oper>
      <ns1:tx_password>password</ns1:tx_password>
      </ns1:user>
      <ns1:cd_service>SUBMIT</ns1:cd_service>
      <ns1:cd_product>IFE</ns1:cd_product>
      <ns1:id_channel>INTEGATE</ns1:id_channel>
      <ns1:id_company>OFFICEWORKS</ns1:id_company>
      <ns1:id_merchant>OFFICEWORKS</ns1:id_merchant>
      <ns1:cd_country>61</ns1:cd_country>
      <ns1:cd_security>IFE</ns1:cd_security>
      </ns1:request>
    - <ns1:application_details>
      <ns1:id_product_credit>COMMERCIAL DECISIONING</ns1:id_product_credit>
      <ns1:id_reference_internal>[APP-ID]</ns1:id_reference_internal>
      <ns1:id_reference_external>[customer ref here]</ns1:id_reference_external>
      <ns1:id_merchant_submit>OFFICEWORKS</ns1:id_merchant_submit>
      </ns1:application_details>
    - <ns1:service>
    - <ns1:application>
    - <ns1:finance>
      <ns1:cd_type_finance>TERMS 30</ns1:cd_type_finance>
      <ns1:am_finance>4000</ns1:am_finance>
      </ns1:finance>
    - <ns1:applicant cd_type="Principal" fg_new="0">
    - <ns1:company>
      <ns1:cd_type_entity>SLTR</ns1:cd_type_entity>
      <ns1:tx_company_abn>41552470947</ns1:tx_company_abn>
      <ns1:nm_company_legal>WESTON, DEAN</ns1:nm_company_legal>
      <ns1:cd_type_industry>OTHER</ns1:cd_type_industry>
      <ns1:no_directors>1</ns1:no_directors>
      <ns1:no_employees>1</ns1:no_employees>
      </ns1:company>
      </ns1:applicant>
    - <ns1:applicant cd_type="CoBorrower1" fg_new="0">
    - <ns1:individual>
      <ns1:cd_title>Mr</ns1:cd_title>
      <ns1:nm_firstname>Dean</ns1:nm_firstname>
      <ns1:nm_surname>Weston</ns1:nm_surname>
      <ns1:dt_dob>1968-12-29</ns1:dt_dob>
      <ns1:cd_gender>M</ns1:cd_gender>
      <ns1:fg_act_privacy>1</ns1:fg_act_privacy>
      <ns1:cd_residence>61</ns1:cd_residence>
      </ns1:individual>
    - <ns1:address>
    - <ns1:current_address>
      <ns1:tx_no_unit>1</ns1:tx_no_unit>
      <ns1:tx_no_street>1</ns1:tx_no_street>
      <ns1:nm_street>Test</ns1:nm_street>
      <ns1:cd_type_street>Rd</ns1:cd_type_street>
      <ns1:nm_suburb>Testerville</ns1:nm_suburb>
      <ns1:cd_state>VIC</ns1:cd_state>
      <ns1:cd_postcode>3000</ns1:cd_postcode>
      <ns1:ct_address_at_time>21</ns1:ct_address_at_time>
      <ns1:cd_country>61</ns1:cd_country>
      </ns1:current_address>
      </ns1:address>
    - <ns1:address>
    - <ns1:previous_address>
      <ns1:tx_no_street>2</ns1:tx_no_street>
      <ns1:nm_street>Wayback</ns1:nm_street>
      <ns1:cd_type_street>Crs</ns1:cd_type_street>
      <ns1:nm_suburb>Sydney</ns1:nm_suburb>
      <ns1:cd_state>NSW</ns1:cd_state>
      <ns1:cd_postcode>2000</ns1:cd_postcode>
      <ns1:ct_address_at_time>117</ns1:ct_address_at_time>
      <ns1:cd_country>61</ns1:cd_country>
      </ns1:previous_address>
      </ns1:address>
    - <ns1:identification>
    - <ns1:drivers_license>
      <ns1:id_number>123456789</ns1:id_number>
      <ns1:fg_verified>1</ns1:fg_verified>
      </ns1:drivers_license>
      </ns1:identification>
    - <ns1:contact>
    - <ns1:home_phone>
      <ns1:tx_area>03</ns1:tx_area>
      <ns1:tx_number>99998888</ns1:tx_number>
      </ns1:home_phone>
      </ns1:contact>
    - <ns1:contact>
    - <ns1:work_phone>
      <ns1:tx_area>03</ns1:tx_area>
      <ns1:tx_number>88887777</ns1:tx_number>
      </ns1:work_phone>
      </ns1:contact>
    - <ns1:contact>
    - <ns1:other_phone>
      <ns1:tx_number>0400123123</ns1:tx_number>
      <ns1:cd_type>Mobile</ns1:cd_type>
      </ns1:other_phone>
      </ns1:contact>
    - <ns1:contact>
    - <ns1:other_phone>
      <ns1:tx_area>03</ns1:tx_area>
      <ns1:tx_number>77776666</ns1:tx_number>
      <ns1:cd_type>Other</ns1:cd_type>
      </ns1:other_phone>
      </ns1:contact>
      </ns1:applicant>
      </ns1:application>
      </ns1:service>
      </ns1:inteflow>
      </ns1:_sRequestXML>
      </ns1:ExecuteXMLRequest>
    Anonymizer bean is stripping the namespace prefix ns1 but it is also stripping the address http://decisionintellect.com/inteport/.
    Below is my anonymizer bean config in PI:
    Processing seq:
    1                    AF_Modules/XMLAnonymizerBean               local enterprise bean            0
    Module config:
    0                   anonymizer.acceptNamespaces                    http://decisionintellect.com/inteport ''
    0                    anonymizer.quote                                          '
    Can someone please suggest how to keep the http://decisionintellect.com/inteport and remove rest of namespace prefixes

  • Updating the DOM with a JSTL import?

    I want to update the content of my page dynamically and I understand how to use javascript and the DOM to access and and change the content that way. My question is can I change the DOM by using a JSTL import statement to specify the content?
    something like:
    <html>
    <script>
    functionAlpha(){
      document.getElementById('content').innerHTML = <c:import url=\"alpha.jsp\" />
    functionBeta(){
      document.getElementById('content').innerHTML = <c:import url=\"beta.jsp\" />
    </script>
      <body>
        <!-- not the best practice here but will work for this example -->
        <a href="javascript:contentAlpha()">Alpah</a>
        <a href="javascript:contentBeta()">Beta</a>
       <div id="content">
        </div>
      </body>
    </html>I have tried the crux of the above and it does not work for me. Please let me know if this should work and i have the syntax wrong or if there are alternative methods to achieve what i am trying to accomplish. any help is appreciated. thanks.

    Likely not. The key point is that you cannot execute serverside languages using clientside languages without sending the information from the client to the server.
    Consider AJAX for what you're trying to achieve (updating content asynchronously).

  • Sample java code which reads xml attributes using DOM Parser

    Hi Friends,
    I am looking for a sample java code which uses the DOM Parser to read the attributes values.
    My xml looks like below
    <?xml version='1.0' encoding='UTF-8'?>
    <root>
    <header unid="100" status="true">
    <validation stage="1" processed="10"/>
    </header>
    </root>
    Experts please help...
    Thanks in Advance
    JJ

    You have probably found lots of resources on the www for this by now, if not: [http://www.w3schools.com/dom/default.asp|http://www.w3schools.com/dom/default.asp]

  • Namespace's problem with xpth and dom parser

    Hello all,
    I’m trying to pars un xml file (below), using xpath, my string "s" is always empty, I do not why.
    the problem is each time my client changes his namespace’s prefix, so I’m asking if I could eliminate all the namespaces dynamically and the I can use the xpath without prefixes:
    Thanks in advance.
    [email protected]
    My xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <fs:Faris xmlns:fs="http://www.test.com">
    <fs:Acknowledgement Receiver="salam" Sender="faris">
    <fs:UUId>12322222</fs:UUId>
    </fs:Acknowledgement>
    </fs:Faris>
    my code:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(false);
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse(new File("C:\\mytest.xml"));
    XPath xpath;
    xpath = XPathFactory.newInstance().newXPath();
    String s = (String)xpath.evaluate("//Acknowledgement//@Receiver", doc,
    XPathConstants.STRING);
    ---------------------------------------------------------------

    You can also deal with this without using JDK 5.0 using a Namespace resolver class doing something similar to this (I know the contains is a little hookey but hey it's an example.)
    private static NodeList getNodeList(Document doc, String xPathExpression)throws XSLException
    NodeList nodes = null;
    XMLDocument xmlDoc = (XMLDocument) doc;
    //the presence of ' :' signifies the xPath expression contains a prefix.
    if (Util.contains(xPathExpression,":"))
    Element rootNode = xmlDoc.getDocumentElement();
    if (rootNode == null) return null;
    String strNS = rootNode.getNamespaceURI();
    //create a ns resolver with URI from the root element this will enable non-prefixed
    //elements in dflt namespace to be resolved.
    NamespaceContextResolver nsResolver = new NamespaceContextResolver(strNS);
    nodes = xmlDoc.selectNodes(xPathExpression,nsResolver);
    } else
    nodes = xmlDoc.selectNodes(xPathExpression);
    return nodes;
    class NamespaceContextResolver implements NSResolver
    String _dfltNs;
    public NamespaceContextResolver(){}
    public NamespaceContextResolver(String dfltNS)
    this._dfltNs = dfltNS;
    public String resolveNamespacePrefix(String prefix) {
    if ("xml".equals(prefix)) return "http://www.w3.org/XML/1998/namespace";
    return this._dfltNs;
    }

Maybe you are looking for

  • View salary details in a single screen in Simulation

    Hi All, InPayroll Simulation is there any way to view the salry details in a sigle screen , insted of going to the drop down and view SD

  • How to tint a JPanel that paints an Image

    Hello all, I have a basic understanding of Java Swing architecture and the Drawing capabilities of the Graphics and Graphics2D classes. However, i am utterly confused how to implement a basic tint over an image. Overview: I have a GCard (Graphical Ca

  • Dual Cable No Longer Charging

    This morning my Thunderbolt Display cable will no longer charge my Macbook Air. No light comes on, and on screen it says "not charging". It will charge with the regular charger. The the Thunderbolt cable has always worked fine, for the couble of year

  • Solaris 10 x86 cdrw trouble.  Gnome and command line problems writing.

    I'm experiencing general weirdness trying to write CD's and DVD's using a new internal DVD-RW device -- It's a Sony NEC AD 7220 A CD / DVD RW drive on a Solaris 10 x86 AMD system. I have searched far and wide for other threads of similar instances bu

  • How we can get an interactive report  in alv grid display?

    Hi experts Plz tell me how we can get an interactive report in alv grid disply pls send me one sample code to understand this thanks in advance