Node Insertion - ensure validity against DTD

I want to create a new XML document, insert elements one by one. How do I ensure that the element is insertable according to DTD specified (i.e. it is valid to insert the new element to the XML document)?
Thank you

You can use class com.ibm.xml.parser.DTD to load your DTD and use the getAppendableElements method. Then you can check if an element is in the appendable elements,...

Similar Messages

  • XML validation against DTD.. Is it possible?

    Hello all,
    Sorry for what may be a trivial post, but I'll keep it short..
    According to the docs:
    "The Validate XML command will validate the XML against the schema defined in the XML file. This command on the context menu is disabled whenever an XML file does not have an XML namespace defined."
    I'm used to the XML editor retrieving a DTD from somewhere and validating it against that.. is it possible to do this in JDev?

    Unfortunately it's not. We only have support for validating against XML Schemas.
    Rob

  • How to disable validation against DTD while unmarshalling

    Hi All
    I am relatively new to XML and JAXB. I have a tool that needs to run offline, however the XML documents that are being read in are automatically being validated against the DTD even though I have specified unmarshaller.setValidating(false). How can I completely diable validation while offline? Here is my code:
    context = JAXBContext.newInstance("my.xmlobjects.package");
    Unmarshaller u = context.createUnmarshaller();
    u.setValidating(false);
    testLog = (TestLog) u.unmarshal(new File("/path/to/my/file.xml"));
    I've also tried a suggestion I saw on another forum (note that I know nothing about SAX, I've been trying to make sense of the documentation):
    SAXParserFactory parserFactory = SAXParserFactory.newInstance();
    parserFactory.setValidating(false);
    SAXParser saxParser = parserFactory.newSAXParser();
    XMLReader xmlReader = saxParser.getXMLReader();
    EntityResolver entityResolver = new EntityResolver()
    public InputSource resolveEntity (String publicId, String systemId)
    return null;
    xmlReader.setEntityResolver(entityResolver);
    InputSource source = new InputSource(new FileInputStream("/path/to/my/file.xml");
    SAXSource saxSource = new SAXSource(xmlReader, source);
    context = JAXBContext.newInstance("my.xmlobjects.package");
    Unmarshaller u = context.createUnmarshaller();
    u.setValidating(false);
    testLog = (TestLog) u.unmarshal(saxSource);
    Both of these work when connected, but fail when disconnected from the internet. Is there an Oracle specific property that needs to be set here?
    Thanks
    Jeff

    Well you can create non validating parser programatically .
    http://edocs.bea.com/wls/docs100/xml/programming.html#wp1069856
    i.e.
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setValidating(false);
    Hope this helps.

  • Validating against dtd

    Hi,
    I am trying to parse an xml against a dtd, using SAX parser. The validation is proper..but i want to parse the entire file even if there is a mismatch in the middle of the xml document.
    say if there is an error at one particular element, the parser throws an exception and quits..but i want the parser to continue with the rest of the document..
    how can i achieve this functionality..
    thanks & regards

    Hi,
    I had put the try catch block, the exception was getting caught and the program was exiting...later i used the ErrorHandler class to handle the exceptions..
    and it is working fine if there is a saxparseexception..
    But if there is some fatal error in the xml file, the parser throws the exception and quits. Is there any way to catch the fatal error and still proceed with the parsing.
    Thanks & regards

  • Complains about " ?xml ....? " then validating against DTD

    We are using Oracle's XML-parser (xmlparserv2.zip) to validate XML-files with DTD-files.
    The problem we are getting is that it complains on the first row in the XML-file:
    It doesn't work when:
         <?xml encoding="ISO-3242"?>
    But it DOES (!??) work when we remove the "x":
         <?ml encoding="ISO-3242"?>
    Can anyone explain this to me? The error message was something about "xml is a reserved..."

    I think the problem is that <?xml encoding="..."> is not a valid as a XML declaration. It must include the attribute version="1.0" e.g. <?xml version="1.0" encoding....>. Otherwise it treats xml as a user defined name, and as the error indicates you cannot declare element names that have xml.
    Hope this helps.

  • XML validation against DTD

    Hi,
    I have an application that receives XML from an external source. The XML received does not have the XML version and the doc type declaration lines. I want to validate the XML against a DTD.
    One dirty way of doing this is to open the XML received and prepend the XML versions and doctype lines to it. And then parse the XML. But is it the right way to do it?
    What I would like to know is that does the XML parser provide any API which can tell it to validate an XML document against a certain DTD.

    Yes, there is an API to do this. You have to do something like this:
    DocumentBuilderFactory dbf          =DocumentBuilderFactory.newInstance();
    dbf.setValidating(true);
    DocumentBuilder db = dbf.newDocumentBuilder();
    XMLErrors eh = new XMLErrors(frame);
    db.setErrorHandler(eh);
    Document doc = db.parse(f);
    (where f is the XML file)
    In this example, the class XMLErrors is used as the ErrorHandler. XMLErrors extends the DefaultHandler class and provides the user with information about the various error levels. A call to the over-ridden "error" method notifies the user (using a Dialog box) that the document doesn't meet the DTD.
    Hope this helps.

  • XML instance validation against XML schema

    How can I get a reference on the error node object after
    validation against an XML schema ?
    Ex. :
    DOMParser domP = new DOMParser();
    domP.setXMLSchema(schemaDoc); // schemaDoc = ref. on an XMLSchema
    domP.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    domP.parse(reader); // reader contains the XML instance data
    If an error occurred, I only get a message string. What I need is to get a reference on the node object which contains the error in order to retrieve its properties to the schema.
    I could then alert the user with a message such as :
    "Data xxx is not valid ; it must be comprised between yy and zz...".
    Did somebody solve this problem ? May I use the XMLError class to do this ?
    Thank you

    Hi Ray,
    Were you able to resolve this issue? I am encountering a very similar problem where I am not connected to the internet and it fails during the newSchema method on javax.xml.validation.SchemaFactory. I have attempted to implement the suggestions of ExtremeGardener and vidyut with no luck.
    Per ExtremeGardener's suggestion of replacing xmlns:xs="http://www.w3.org/2001/XMLSchema" with xmlns:xs="XMLSchema.xsd" and storing it locally, it gave me an error for trying to set the "xs" or "xsd" prefixes to anything other than "http://www.w3.org/2001/XMLSchema." I forget the exact error. I also tried to use my own prefix and it did not like that either.
    Per vidyut's suggestion of using a catalog resolver, I believe that I have tried that too (if I understand correctly). I created an LSResourceResolver and tied it to the SchemaFactory. I can invoke it for a namespace but that did not resolve the issue because it only invokes the resolver on an import, include, or redefine. I believe that it is trying to reach the internet due to the xmlns:xs="http://www.w3.org/2001/XMLSchema" attribute within the top-level schema element in the XSD and I know of no way to invoke it for that.
    I also created an ErrorHandler and tied it to the SchemaFactory. That shows me the errors and they are all related to the standard XML data types defined in XMLSchema.xsd. The errors that I am seeing are all of this form: "UndeclaredPrefix: Cannot resolve 'xs:string' as a QName: the prefix 'xs' is not declared."
    I am currently using the SchemaFactory in Java 1.5, but I am thinking about trying the Xerces SchemaFactory since they are not exactly the same implementation.
    Does anyone have any other suggestions? Any help you can provide would be greatly appreciated!
    Thanks,
    betzro1

  • Regarding validating XML against DTD

    hello,
    In my project I am receiving xml via HTTP post request
    and this XML needs to be validated against a DTD in a remote server.
    e.g. assume the xml to be
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE PUSH SYSTEM "http:\\whatever:xx\whatever\sms.dtd">
    <PUSH ICP="Partenaire" ADM="UtilisateurChezPartenaire" VERSION="1.0">
    </PUSH>
    the java code uses Xerces parser
          DOMParser parser = new DOMParser();
          parser.setFeature("http://xml.org/sax/features/validation", true);
          parser.setProperty(
                             "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
                             "http:\\whatever:xx\whatever\sms.dtd"");
          parser.parse("c://localcopy/sms.xml");this Works fine.
    But in some case I receive xml file without any !DOCTYPE declaration
    (but is still needs to be validated against the same DTD as its mentioned in the business rules)
    in such case how can the XML be validated against the DTD.
    am I extected to add the
    <!DOCTYPE PUSH SYSTEM "http:\\whatever:xx\whatever\sms.dtd">
    to every XML via some XSLT script or is there a direct way of
    validating a xml that has no DOCTYPE reference to a DTD
    (the assumption is the DTD location is known beforehand)

    ok, i managed to solve the problem my self, using Transformer makes the job easier.
    here is the code for anyone who might run into the same problem.#
         public void whatEver(){
              try{
                   DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
                   Document xmlDocument = dBuilder.parse(new FileInputStream("c://a.xml"));
                   DOMSource source = new DOMSource(xmlDocument);
                   //StringWriter writer = new StringWriter();
                   StreamResult result = new StreamResult("c://a.xml");
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer transformer = tf.newTransformer();
                   transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "./transformations/Push_Gateway.dtd");
                   //TransformerFactory transformerFactory = TransformerFactory.newInstance();
                   //Transformer newtransformer = transformerFactory.newTransformer();
                   transformer.transform(source, result);
              catch(Exception e){
                   e.printStackTrace();
         }the above code reads the a.xml file and adds/removes the DOCTYPE as specified in the transformer.setOutputProperty method and the same xml file is updated, this way different DTD could be referenced by the same xml and validated. this saves the process of adding/removing DOCTYPE via xslt.

  • URGENT---Validating XML file against DTD

    I have a XML & DTD file.I want to validate that xml file against the specified DTD without using any editor.Through program how can i validate?Pl. help me.It's URGENT.

    >
    and i recieved ORA-31001: Invalid resource handle or path name "/testdtd.dtd"
    when the DBMS_XMLPARSER.parseClob( PARSER , v_xml ); is executed
    i removed the <!DOCTYPE family SYSTEM "testdtd.dtd"> from the XML file
    the procedures worked , but not sure if really validated against the DTD file>
    you have to load your DTD into XDB repository.
    <a href ="http://forums.oracle.com/forums/thread.jspa?threadID=416366">How do I use DTD's with XML DB ?
    Ants

  • Validating against a DTD specified externally

    Hi all,
    I don't know if this is possible (well anything is possible):
    I would like to validate an XML file from a DTD that I specify. The problem that I have is that the XML is generated by an external system and it can be deployed either on a unix or windows architecture.
    I load the XML from file located on either architecture and I want to control the location on either system where the DTD is kept and if possible tell the validator what DTD to use. I am having problems using relative paths when specifying the DTD in the XML and the company doesn't want to use an external public URI.
    I am using Java 1.4 and SAX 2.0 . Any pointers or help would be very much appreciated [code is even better ;-)]

    Hi,
    I cant seem to make the EntityResolver work properly. I was tasked to validate a lot of XML files but they do not have a DOCTYPE entity because the location of the dtd is configurable.
    i have stripped down the xml to only contain the root for brevity of testing but i am still stuck. the xml is this:
    <?xml version="1.0" encoding="utf-8"?>
    <ngui full="f" r="f">
    </ngui>and my validation code is this
    public class SimpleXMLValidator {
      public boolean validate(String xmlFilePath, String schemaFilePath){
            boolean validXML = true;
            System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
                               "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            factory.setValidating(true);
            //factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
                                          "http://www.w3.org/2001/XMLSchema" );
            //factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource",schemaFilePath);
            try {
                DocumentBuilder builder = factory.newDocumentBuilder();
                ExternalResolver er = new ExternalResolver();
                er.addURL(schemaFilePath);
                builder.setEntityResolver(er);
                builder.parse(new File(xmlFilePath));
            } catch (ParserConfigurationException e) {
                validXML = false;
                e.printStackTrace();
            } catch (SAXException e) {
                validXML = false;
                e.printStackTrace();
            } catch (IOException e) {
                validXML = false;
                e.printStackTrace();
            return validXML;
       private class ExternalResolver implements EntityResolver{
            private HashMap urlMap = null;
            public InputSource resolveEntity(String publicId, String systemId){
                System.out.println("resolvedEntity:" +publicId +" and "+systemId);
                if ( urlMap != null && urlMap.get(systemId)!= null ){
                    try {
                        return new InputSource(new FileReader(systemId));
                    } catch (FileNotFoundException e) {
                        System.out.println("[ERROR] Unable to load entity reference: " + systemId );
                return null;
            public void addURL(String filePath) throws MalformedURLException{
                addURL(new File(filePath).toURL());
            public void addURL(URL url) {
                if ( urlMap == null ){
                    urlMap = new HashMap();
                urlMap.put(url, null);
    }If I hardcode the DOCTYPE then the file passes through the validation. and printout the System.out that I placed in the entity resolver. However I am getting the following exceptions:
    * if I remove the hard-coded DOCTYPE (notice that the EntityResolver output line is not written)
    C:\APPS\Eclipse-ws\testbed\bin>java SimpleXMLValidator ..\testdata\ac3.xml  ..\testdata\ngui.dtd
    Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
    set, which is probably not what is desired.  Parser will use a default
    ErrorHandler to print the first 10 errors.  Please call
    the 'setErrorHandler' method to fix this.
    Error: URI=file:C:/APPS/Eclipse-ws/testbed/bin/../testdata/ac3.xml Line=2: Document is invalid: no grammar found.
    Error: URI=file:C:/APPS/Eclipse-ws/testbed/bin/../testdata/ac3.xml Line=2: Document root element "ngui", must match DOCTYPE root "null".* if I uncomment the setAttribute calls:
    C:\APPS\Eclipse-ws\testbed\bin>java SimpleXMLValidator ..\testdata\ac3.xml  ..\testdata\ngui.dtd
    resolvedEntity:null and file:C:/APPS/Eclipse-ws/testbed/testdata/ngui.dtd
    org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
            at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
            at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
            at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
            at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
            at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
            at SimpleXMLValidator.validate(SimpleXMLValidator.java:61)
            at SimpleXMLValidator.main(SimpleXMLValidator.java:40)* the setAttributes is still active in the compiled class but this time I hardcoded the DOCTYPE again.
    C:\APPS\Eclipse-ws\testbed\bin>java SimpleXMLValidator ..\testdata\ac3.xml  ..\testdata\ngui.dtd
    resolvedEntity:null and file:C:/APPS/Eclipse-ws/testbed/testdata/ngui.dtd
    resolvedEntity:null and file:C:/APPS/Eclipse-ws/testbed/testdata/ngui.dtd
    org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
            at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
            at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
            at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
            at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
            at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
            at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
            at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
            at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
            at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
            at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
            at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
            at SimpleXMLValidator.validate(SimpleXMLValidator.java:61)
            at SimpleXMLValidator.main(SimpleXMLValidator.java:40)does anybody know what I am missing here? Thanks.
    ciao!
    [edit] This posting of mine looks horrible both on IE and Firefox because its HTML tags are all in the text. I posted this question in http://ramfree17.org/capsule/?p=38 which is hopefully more readable.

  • ERROR: "info.plist does not validate against DTD"

    Hi! I got this error if anyone has it solved Please HELP.
    I am trying to package a WRT widget using Nokia WRT extension for Adobe Dreamweaver. This is the place for info on the extension: http://www.forum.nokia.com/Tools_Docs_and_Code/Tools/Runtimes/Web_Runtime/
    I figure developer from here who use DW to develop mobile content might know the error.
    When come to the step of 'Package Nokia WRT Widget' I got this error: info.plist does not validate against DTD
    and a page of error info shown like this:
    DTD validated at: Wed Jun 17 2009 19:03:00 GMT+0800 (Malay Peninsula Standard Time)
    DTD used for validation: http://www.nokia.com/DTDs/plist-1.0.dtd
    Line
    Column
    Message
    Explanation
    Source
    2
    95
    DTD did not contain element declaration for document type name
    3
    16
    Attribute "version" exists, but can not be used for this element.
    3
    21
    element "plist" undefined. Did you mean "applet" or "strike"?
    4
    7
    element "dict" undefined. Did you mean "strike" or "input"?
    5
    7
    element "key" undefined. Did you mean "strike" or "blockquote"?
    6
    10
    element "string" undefined. Did you mean "strong" or "strike"?
    7
    7
    element "key" undefined. Did you mean "strike" or "blockquote"?
    8
    10
    element "string" undefined. Did you mean "strong" or "strike"?
    9
    7
    element "key" undefined. Did you mean "strike" or "blockquote"?
    10
    10
    element "string" undefined. Did you mean "strong" or "strike"?
    11
    7
    element "key" undefined. Did you mean "strike" or "blockquote"?
    12
    10
    element "string" undefined. Did you mean "strong" or "strike"?
    13
    7
    element "key" undefined. Did you mean "strike" or "blockquote"?
    14
    9
    element "true" undefined. Did you mean "textarea" or "tr"?
    Can anyone knows what this means and how i can solve it?
    Please help. Thankyou.
    note: I am new here and knows that keep asking quesion without giving back is not good but I have a deadline here and wanted to finish the job. I will read some other post and try to help in return when I am able to do so.

    Hi pziecina,
    Thanks for your reply,
    I suspect my problem is the installation or setup of my system or software. as the result i tested is not by doing any scripting at all. All I did is following one of their example exactly (http://www.forum.nokia.com/Tools_Docs_and_Code/Tools/Runtimes/Web_Runtime/Dreamweaver_Exte nsion/QuickStart.xhtml) and package strightaway without modifying the code. because I want to make sure i got the extension install correctly. even so by packaging one of their ready make example already yield this error.

  • Using XSL on XML validated against XSD

    Transforming XSD validated XMLType Data
    Re: example XSL in Chapter 6 that transforms XML with associated XSD schema definition (Oracle 9i XML Database Developer's Guide)
    I noted that this XSL uses only the "general" node identification functions (e.g., name() ) to access nodes in the <xsl:value-of select..>. I have also noted that standard XSL templates from other sections of the documentation, for example in Chapter 3 and in Appendix D, do not work with an XML which is validated against an XSD schema.
    Can anyone give me an example <xsl:value-of select..> that addresses a specific node in the "purchase order" example, like the shipTo, name, street -- or any other specific node. This is critical since there is always bound to be node-specific processing in any transformation, and this is not demonstrated by any example of XML which has been validated against an XSD.
    I have tried this endlessly on my own examples of XML w/XSD validation. Even if the value-of select="name(.)" tells you that the name of the node is "FooBar", you cannot use FooBar as a select test to do FooBar specific processing.
    Help?????

    Not quite understand your question. Can you send me the example doc?

  • XSL used on XML validated against XSD

    Transforming XSD validated XMLType Data
    Re: example XSL in Chapter 6 that transforms XML with associated XSD schema definition (Oracle 9i XML Database Developer's Guide)
    I noted that this XSL uses only the "general" node identification functions (e.g., name() ) to access nodes in the <xsl:value-of select..>. I have also noted that standard XSL templates from other sections of the documentation, for example in Chapter 3 and in Appendix D, do not work with an XML which is validated against an XSD schema.
    Can anyone give me an example <xsl:value-of select..> that addresses a specific node in the "purchase order" example, like the shipTo, name, street -- or any other specific node. This is critical since there is always bound to be node-specific processing in any transformation, and this is not demonstrated by any example of XML which has been validated against an XSD.
    I have tried this endlessly on my own examples of XML w/XSD validation. Even if the value-of select="name(.)" tells you that the name of the node is "FooBar", you cannot use FooBar as a select test to do FooBar specific processing.
    Help?????

    Not quite understand your question. Can you send me the example doc?

  • Oracle XML Parser validation against XML Sxhema

    Hi,
    I am developing a program in C++ on Unix, that does parsing on an XML document. For parsing I am using "Oracle XML Parser" [using DOM API]. My question is, Can Oracle XML Parser validate xml document against an XML Schema file also? I have read in many tutorials that it can validate against DTD. Please clarify my question as early as possible?
    Regards,
    Raghuram.

    Hi Kulkarni,
    I think you are trying to retrieve the text of the parent element of book. For example if this is the xml element
    <bookdetails>
    <book>Harry Potter</book>
    <author>JK Rowling</author>
    <price>34.55</price>
    </book>
    </bookdetails>
    You must be trying to retrieving the text of bookdetails.
    Check XMLNode.getNodeName() to retrieve the name of the node.
    To get 'Harry Potter' as output you need to traverse till book and then use XMLNode.getText()
    You can check the 'getQuestions()' method in Survey Sample
    to know how to tranverse to any element of an XML using Java.
    The Survey Sample is located at
    http://otn.oracle.com/sample_code/tech/xml/survey/content.html
    Download the sample and unjar it. The location of Analyser.java is
    SurveySample\code\Survey\src\oracle\otnsamples\survey\business\Analyser.java
    Have a look at it.
    Regards,
    Anupama
    http://otn.oracle.com/sample_code/content.html

  • XML Validation with DTD... Urgent

    Hi all,
    I am using java 1.4
    I have to validate the XML file with the external DTD.
    Can anyone give me the code for that.
    DTD should be external.
    Thanks,
    Vinayak.

    If you are using Solaris , it has xml validation tool "xmllint", using this you can validate your xml against DTD.
    try with "xmllint --help " to see all the option.
    Message was edited by:
    sasrivas

Maybe you are looking for

  • MacOS, Bootcamp, Win-Antivirus and (...User symlinks?)

    Hi, I'd appreciate some command line help on this issue: My setup: 750GB HDD with MacOS, apps, and Admin account, and Bootcamp partition; 2 1TB HDDs RAIDed 0 for 2 User accounts; Bootcamp: Win XP SP3, McAfee Security, MacDrive (enabling access to Mac

  • How to create Chart

    Hi pals, Im trying to implement a jsp application which is capable of creating charts dynamically, The thing i need to know is how to create chart application in jsp.?

  • I want to upgrade my Power Mac G5 Quad (Mac OS X 10.5.8) for video editing purposes. What upgrades should I make?

    Hello! I want to upgrade my Power Mac G5 Quad (Mac OS X 10.5.8) for video editing purposes. Rendering,editing and exporting takes some time on my computer. I just want things to go faster. What upgrades should I make? Thanks in advance!!!

  • Oracle Discoverer Database access

    When I install Discoverer, it creates an Oracle database as part of the installation process. Is this the only database that this installation can access? Does this mean that all my reporting data should be migrated to this new database? What would I

  • LSO implementation

    Hi, We are planning to implement LSO in our portal. We are using EP 6.0 and EP 07. But i don't find any roles or iviews in the portal content. Do we have to deploy any business or support packages specific to LSO? Can anyone provide me any info abt w