XPath with XML Schema

Is there any way of finding out the namespace prefix if there is one, from a DOMParser instance or a XMLDocument instance?
I have a DOMParser instance and I don't know whether there is a namespace specification in it. If there is, I need to know what it is so I can update my XPath expressions to use the appropriate prefix.
I have tried the XMLDocument.getNamespace function but it doesn't seem to be implemented (or it is depricated).
Any help would be greatly appreciated.

You're right on track with the namespaces hunch.
XPath 1.0 does not provide the ability to search on the default namespace.
That is, even if you document looks like this:<foo xmlns="urn:bar"/>you cannot use any compliant XPath 1.0 implementation to find the <foo> element with the pattern /foo, since in XPath 1.0 /foo finds the <foo> element that is the child of the root with a null namespace URI.
In the example above, the namespace uri of the <foo> element is urn:bar, so in particular it's not null.
With XPath 1.0, you need to specifically qualify the foo element with a namespace prefix that is bound to the same namespace URI as your default namespace.
So, your XPath would need to look like /xxx:foo where xxx is an arbitrary namespace prefix associated with the urn:bar namespace URI.
The selectNodes, selectSingleNode, and valueOf methods all have an overloading which takes an instance of the oracle.xml.parser.v2.NSResolver interface as the 2nd argument. This argument is used to resolve what namespace prefixes found in the XPath search string map to.
To implement the NSResolver interface, you need only implement a single method:
String resolveNamespacePrefix(String prefix);
In the example above, this method would return the string "urn:bar" when passed the prefix string "xxx" so that the XPath of /xxx:foo would match the <foo> element with urn:bar namespace uri in the example document above.
Steve Muench
Development Lead, Oracle XSQL Pages Framework
Lead Product Manager for BC4J and Lead XML Evangelist, Oracle Corp
Author, Building Oracle XML Applications
null

Similar Messages

  • Dynamic Table with XML Schema

    Hi, I am new to livecycle and wondering if there is any sample for setting up the dynamic table with XML schema so I can access the data through workbench's xpath. thanks.

    Ivor,
    Take a look at the samples shipped with Designer. For 8.2.1 release take a look at
    C:\Program Files\Adobe\LiveCycle Designer ES\8.2\EN\Samples\Forms\Purchase Order\Schema\Schema\Purchase Order.xsd
    and the form samples.
    Otherwise, forward a request to [email protected] I would be happy to send you a sample XDP with a dynamic table and a schema.
    Steve

  • Mapping with xml-schema XML-data to relational tables

    Hello,
    is it possible to map data from xml documents to relational tables with xml-schema?
    I mean not in nested tables but in relational tables with primary and foreign keys!
    With SQL Server 2005 it is very easy, I dont believe that Oracle couldn't do this!
    I searched but i cant find anything about that!
    Thx
    user445232

    indeed, oracle does this for xml schema based xmltype data, however, these underlying tables are not accessable to the application. Maybe It should for next version, so folks who like to use relational model can use it without mapping it manually.
    Actually, nested tables, are the same, their underlying tables (segments) are indeed relational tables, oracle manages them internally and not visiable to the application. You can find them in the user_segments, user_objects views though.

  • Validation XML documnet with XML Schema in PL/SQL

    Hello,
    can someone please explain
    How to validate an XML document with XML schema using PL/SQL code (with out writing Java code).
    Thanks for your Help in Advance
    Surendra.

    see the posting: Schema validation routine?
    regards, Bart

  • Has anybody tried creating and validating a XML doc with XML Schema?

    Hi,
    Has anybody tried creating and validating a XML doc with XML Schema?

    With XMLBeans, an XML document may be created from and validated with an XML schema.

  • Defining entities with XML schema

    Hi,
    I came across a problem with XML schema's apparent lack of support for entities. e.g. we define an entity like this:
    <!ENTITY le "&#x2264;" >.
    First off I was trying in my XML instance to include an external entity file like this:
    <!DOCTYPE wpi [
    <!ENTITY % DerwentXmlEntities PUBLIC "-//Derwent//Derwent XML General ENTITIES 20000214//EN"
    "derwent-xml-entities.ent">
    %DerwentXmlEntities;
    ]>
    <WPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.derwent.co.uk/wpi.xsd">
    but I am not clear on where I should place the file derwent-xml-entities.ent. Everything I tried ended up with:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00202: could not open file "derwent-xml-entities.ent"
    Is it possible to include a file like this?
    So I tried just defining an entity like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE wpi [
    <!ENTITY times "&#x00D7;">
    <!ENTITY le "&#x2264;">
    ]>
    The "times" seems OK, but for "le" I get:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 8804 (\u2264)
    What sort of encoding should I use?
    Thanks
    Pete

    <xsd:element name="PsL">
    <xsd:annotation>
    <xsd:documentation>
    **Pseudo List, required as in D-types, the editors often used the
    {H control sequence to force an indent to make lists of compounds more
                    legible.  We can't be sure that they are always lists but there is
                    useful mark-up there that we wouldn't want to lose**
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="PsE" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="PsE">
            <xsd:annotation>
                <xsd:documentation>
                Pseudo List Entry
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="1">
                    <xsd:element ref="PsP" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="PsS" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="PsP">
            <xsd:annotation>
                <xsd:documentation>
                Pseudo List Prefix
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:choice minOccurs="0" maxOccurs="unbounded">
                    <xsd:element name="PsP" type="xsd:string"/>
                    <xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
                </xsd:choice>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="PsS">
            <xsd:annotation>
                <xsd:documentation>
                Pseudo List Suffix
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:choice minOccurs="0" maxOccurs="unbounded">
                    <xsd:element name="PsS" type="xsd:string"/>
                    <xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
                </xsd:choice>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="Prt">
            <xsd:annotation>
                <xsd:documentation>
                ************************ Part Container Element **************
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="1">
                    <xsd:element ref="PrtNo" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="PrtNm" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="PrtNo">
            <xsd:annotation>
                <xsd:documentation>
                PartNo
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:choice minOccurs="0" maxOccurs="unbounded">
                    <xsd:element name="PrtNo" type="xsd:string"/>
                    <xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
                </xsd:choice>
            </xsd:complexType>
        </xsd:element>
    xsd:element name="PrtNm">
            <xsd:annotation>
                <xsd:documentation>
                PartName
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:choice minOccurs="0" maxOccurs="unbounded">
                    <xsd:element name="PrtNm" type="xsd:string"/>
                    <xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
                </xsd:choice>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="L">
            <xsd:annotation>
                <xsd:documentation>
                ************************ List  Container Element *************
            Attribute typ=used by the composition software to decide how to prefix
                                    the list entries, e.g. (a), (A), (i), (1), etc.
                                    AL for AlphaLower
                                    AU for AlphaUpper
                                    RL for RomanLower
                                    RU for RomanUpper
                                    No for Number
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="unbounded">
                    <xsd:element ref="LP" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="LS" minOccurs="0" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:attribute name="typ" use="optional">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="AL"/>
                            <xsd:enumeration value="AU"/>
                            <xsd:enumeration value="RL"/>
                            <xsd:enumeration value="RU"/>
                            <xsd:enumeration value="No"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="LP">
            <xsd:annotation>
                <xsd:documentation>
                List Paragraph
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:choice minOccurs="0" maxOccurs="unbounded">
                    <xsd:element name="LP" type="xsd:string"/>
                    <xsd:element ref="Sub" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Sup" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="Em" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="RefD" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="RefF" minOccurs="1" maxOccurs="1"/>
                </xsd:choice>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="LS">
            <xsd:annotation>
                <xsd:documentation>
                1st level sublist
            Attribute typ=used by the composition software to decide how to prefix
                                    the list entries, e.g. (a), (A), (i), (1), etc.
                                    AL for AlphaLower
                                    AU for AlphaUpper
                                    RL for RomanLower
                                    RU for RomanUpper
                                    No for Number
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="unbounded">
                    <xsd:element ref="LP" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="LSS" minOccurs="0" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:attribute name="typ" use="optional">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="AL"/>
                            <xsd:enumeration value="AU"/>
                           <xsd:enumeration value="RL"/>
                            <xsd:enumeration value="RU"/>
                            <xsd:enumeration value="No"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="LSS">
            <xsd:annotation>
                <xsd:documentation>
                2nd level list
            Attribute typ=used by the composition software to decide how to prefix
                                    the list entries, e.g. (a), (A), (i), (1), etc.
                                    AL for AlphaLower
                                    AU for AlphaUpper
                                    RL for RomanLower
                                    RU for RomanUpper
                                    No for Number
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="LP" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="typ" use="optional">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="AL"/>
                            <xsd:enumeration value="AU"/>
                            <xsd:enumeration value="RL"/>
                            <xsd:enumeration value="RU"/>
                            <xsd:enumeration value="No"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="IndexingCorePt">
            <xsd:annotation>
                <xsd:documentation>
                ******** ROOT ELEMENT for Core Patent Indexing   *********
                ** Indexing is composed of Derwent Classification (DC),IPCs,
                    Fragmentation Coding (Frags), Polymer Indexing, Unlinked Registry numbers
                    and Keyword Indexing (KI).
                    Any combination is these three elements is allowed.
                Attribute vs        =Version number starting at 0
                    Attribute co    =Patent country
                    Attribute se    =Patent serial
                    Attribute ki    =Patent Kind
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="1">
                    <xsd:element ref="DC" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="IPCs" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="Frag" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="Polymer" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="IdxU" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="KI" minOccurs="0" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:attribute name="vs" type ="xsd:NMTOKEN" use="optional"/>
                <xsd:attribute name="co" type ="xsd:NMTOKEN" use="required"/>
                <xsd:attribute name="se" type ="xsd:NMTOKEN" use="required"/>
                <xsd:attribute name="ki" type ="xsd:NMTOKEN" use="required"/>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="DC">
            <xsd:annotation>
                <xsd:documentation>
                ************* DERWENT CLASSIFICATION *******************
                ** Derwent Classification is divided in 3 main areas:
                    Chemical(CPI),General &amp; Mechanical (EngPI),
                    Electronic &amp; Electronical (EPI)
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:choice minOccurs="1" maxOccurs="1">
                    <xsd:sequence minOccurs="1" maxOccurs="1">
                        <xsd:element ref="CPIs" minOccurs="1" maxOccurs="1"/>
                        <xsd:element ref="EngPIs" minOccurs="0" maxOccurs="1"/>
                        <xsd:element ref="EPIs" minOccurs="0" maxOccurs="1"/>
                    </xsd:sequence>
                    <xsd:sequence minOccurs="1" maxOccurs="1">
                        <xsd:element ref="EngPIs" minOccurs="1" maxOccurs="1"/>
                        <xsd:element ref="EPIs" minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
                    <xsd:element ref="EPIs" minOccurs="1" maxOccurs="1"/>
                </xsd:choice>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="CPIs">
            <xsd:annotation>
                <xsd:documentation>
                UNIQUE ELEMENT DC
                ** Container element for CPI**
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="CPI" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="CPI">
            <xsd:annotation>
                <xsd:documentation>
                UNIQUE ELEMENT CPIs
                ** CPI is composed of sections A to N (no section I)
                    Any combination is allowed, there has to be at least one section.
                    No section can appear twice. The DTD does not enforce this.
                    Section N can't be on his own. The DTD does not enforce this.
                    Each single Chemical section is composed of one main class (DCCM)
                    and zero to many secondary classes (DCCSs). One to many Manual
                    code (MCCs) has to be applied to a given chemical section.
                    Attribute section= an allowed Derwent CPI section    **
                Note that content MCCs is optional as its optional in the backfile
                    before 19??
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:choice minOccurs="1" maxOccurs="1">
                    <xsd:sequence minOccurs="1" maxOccurs="1">
                        <xsd:element ref="DCCM" minOccurs="1" maxOccurs="1"/>
                        <xsd:element ref="DCCSs" minOccurs="0" maxOccurs="1"/>
                        <xsd:element ref="MCCs" minOccurs="0" maxOccurs="1"/>
                    </xsd:sequence>
                    <xsd:element ref="MCCs" minOccurs="1" maxOccurs="1"/>
                </xsd:choice>
                <xsd:attribute name="sct" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="A"/>
                            <xsd:enumeration value="B"/>
                            <xsd:enumeration value="C"/>
                            <xsd:enumeration value="D"/>
                            <xsd:enumeration value="E"/>
                            <xsd:enumeration value="F"/>
                            <xsd:enumeration value="G"/>
                            <xsd:enumeration value="H"/>
                            <xsd:enumeration value="J"/>
                            <xsd:enumeration value="K"/>
                            <xsd:enumeration value="L"/>
                            <xsd:enumeration value="M"/>
                            <xsd:enumeration value="N"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="DCCM" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                ** Derwent Class Chemical Main element **
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="DCCSs">
            <xsd:annotation>
                <xsd:documentation>
                ** Derwent Classes Chemical Secondary Container element**
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="DCCS" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    <xsd:element name="DCCS" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                ** A Derwent Class Chemical Secondary (DCCS) **
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="MCCs">
            <xsd:annotation>
                <xsd:documentation>
                ** Manual Codes CPI Container Element **
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="MCC" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="MCC" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                ** A Manual Code CPI **
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="EngPIs">
            <xsd:annotation>
                <xsd:documentation>
                **General &amp; Mechanical Sections Container element**
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="EngPI" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="EngPI">
            <xsd:annotation>
                <xsd:documentation>
                UNIQUE ELEMENT EngPIs
                ** General &amp; Mechanical Sections EngPI is composed of sections
                    P and Q. Any combination is allowed, with at least one section.
                    There are no manual codes for these sections.
                    Each single EngPI section is composed of
                    one or more Derwent Class Engineering (DCEng) elements.
                    No section can appear twice. The DTD does not enforce this.
                    Attribute section= an allowed Derwent EngPI section         **
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="DCEngs" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
                <xsd:attribute name="sct" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="P"/>
                            <xsd:enumeration value="Q"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="DCEngs">
            <xsd:annotation>
                <xsd:documentation>
                ** Derwent Class Engineering Container eement **
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="DCEng" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    <xsd:element name="DCEng" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                ** Derwent Class Engineering  **
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="EPIs">
            <xsd:annotation>
                <xsd:documentation>
                ** Electronic &amp; Electrical Sections EPI **
                Container element for EPI
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="EPI" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="EPI">
            <xsd:annotation>
                <xsd:documentation>
                UNIQUE ELEMENT EPIs
                ** EPI is composed of sections R to X. Any combination is allowed,
                      with at least one section.
                     Section R can't be on his own. The DTD does not enforce this.
                     Each single is composed of one or more Derwent Class Electronic
                     and Electrical (DCE) elements.
                     No section can appear twice. The DTD does not enforce this. **
         Attribute sct = an allowed Derwent EPI section        
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="EPIgp" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="sct" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="R"/>
                            <xsd:enumeration value="S"/>
                            <xsd:enumeration value="T"/>
                            <xsd:enumeration value="U"/>
                            <xsd:enumeration value="V"/>
                            <xsd:enumeration value="W"/>
                            <xsd:enumeration value="X"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="EPIgp">
            <xsd:annotation>
                <xsd:documentation>
                ** A Container element to group the related DCE &amp; MCEs elements **
                Note that content MCEs is optional as its optional in the backfile
                     before 19??
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="1">
                    <xsd:element ref="DCE" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="MCEs" minOccurs="0" maxOccurs="1"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="DCE" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                ** Derwent Class Electronic &amp; Electrical (DCE) contains
                     Manual Codes Electronic &amp; Electrical (MCE)              **
                ** Derwent Class EPI **
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="MCEs">
            <xsd:annotation>
                <xsd:documentation>
                ** Manual Codes EPI container element **
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="MCE" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="MCE" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation>
                ** A Manual Code EPI **
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="IPCs">
            <xsd:annotation>
                <xsd:documentation>
                ********************IPCs Container element *************
                ** The following xlink construct is a link to the IPC codes on
                     the WIPO site, this could be added to the DTD to provide the link
                     without adding any thing to the individual instances
                     xlink:type   (locator)  #FIXED     "locator"
                     xlink:rl   NMTOKEN       #FIXED     "IPCs"
                     xlink:href CDATA #FIXED "http://classifications.wipo.int/fulltext/new_ipc/"
                     xlink:title  CDATA       #FIXED     "IPC Codes"            **
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="IPC" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="IPC">
            <xsd:annotation>
                <xsd:documentation>
                UNIQUE ELEMENT IPCs
                ** An IPC Code **
                ** Attribute rnk= Derwent assigned character to indicate type
                     of IPC:
                          A= Main IPC
                          B= Other, unlinked IPCs
                          C to Y = Linked IPCs and Index Terms
                          Z= IPC Index Terms
                          -= Additional terms                       **
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
             <xsd:simpleContent>
              <xsd:extension base="xsd:string">
                <xsd:attribute name="rnk" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="A"/>
                            <xsd:enumeration value="B"/>
                            <xsd:enumeration value="C"/>
                            <xsd:enumeration value="D"/>
                            <xsd:enumeration value="E"/>
                            <xsd:enumeration value="F"/>
                            <xsd:enumeration value="G"/>
                            <xsd:enumeration value="H"/>
                            <xsd:enumeration value="I"/>
                            <xsd:enumeration value="J"/>
                            <xsd:enumeration value="K"/>
                            <xsd:enumeration value="L"/>
                            <xsd:enumeration value="M"/>
                            <xsd:enumeration value="N"/>
                            <xsd:enumeration value="O"/>
                            <xsd:enumeration value="P"/>
                            <xsd:enumeration value="Q"/>
                            <xsd:enumeration value="R"/>
                            <xsd:enumeration value="S"/>
                            <xsd:enumeration value="T"/>
                            <xsd:enumeration value="U"/>
                            <xsd:enumeration value="V"/>
                            <xsd:enumeration value="W"/>
                            <xsd:enumeration value="X"/>
                            <xsd:enumeration value="Y"/>
                            <xsd:enumeration value="Z"/>
                            <xsd:enumeration value="-"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
               </xsd:extension>
             </xsd:simpleContent>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="Frag">
            <xsd:annotation>
                <xsd:documentation>
                ***************BCE INDEXING OR FRAGMENTATION ************
                ** Fragmentation Container element**
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="FragSub" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="FragSub">
            <xsd:annotation>
                <xsd:documentation>
                UNIQUE ELEMENT Frag
                ** Fragmentation Sub heading **
                ** Attribute sjct=The main BCE chemical subject categories
                     defined by Derwent as subsets. The subsets are designated by the
                     subheadings MO through M6:
                          MO  Agricultural, pharmaceutical     1963-1969
                          M1  Agricultural, pharmaceutical natural products
                                         and polymers     1970 to present
                          M2  Agricultural, pharmaceutical         1970 to present
                          M3  General chemicals                    1970 to present
                          M4  Dyes                                 1970 to present
                          M5  Steroids                             1963 to present
                          M6  Galenicals                           1976 to present"**
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="CardRec" minOccurs="1" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="sjct" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:enumeration value="M0"/>
                            <xsd:enumeration value="M1"/>
                            <xsd:enumeration value="M2"/>
                            <xsd:enumeration value="M3"/>
                            <xsd:enumeration value="M4"/>
                            <xsd:enumeration value="M5"/>
                            <xsd:enumeration value="M6"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="CardRec">
            <xsd:annotation>
                <xsd:documentation>
                ** Card Record **
                     Attribute no     =Derwent assigned record number
                     Attribute mc     = Markush DARC Control Code
                     Attribute trc     = Fragmentaion Control Time ranging codes:
                                    M900     Pre-1970
                                    M901     1970-1971
                                    M902     1972-1981 (8126)
                                    M903     1981 (8127) onward
                                    M905
                     Attribute rn      = 910 Codes generated from registry numbers.
                                    Only searchable from 1981
                     Attribute wd = 911 Wide Disclosure. Only searchable from 1981
                </xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
                <xsd:sequence minOccurs="1" maxOccurs="1">
                    <xsd:element ref="FCodes" minOccurs="1" maxOccurs="1"/>
                    <xsd:element ref="RINs" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="SCNs" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="MCNs" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="DRNs" minOccurs="0" maxOccurs="1"/>
                    <xsd:element ref="DCRs" minOccurs="0" maxOccurs="1"/>
                </xsd:sequence>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

  • I am facing a new problem with xml schema, plz help me

    Hi @,
    I am facing a problem with xml schema validation. Below is my code.
    public void initialize(String cfgFileName) {
    try {
    try {
    DOMParserWrapper parser = (DOMParserWrapper)Class.forName("dom.wrappers.DOMParser").newInstance();
    parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",true );
    parser.setFeature( "http://xml.org/sax/features/validation",true);
    parser.setFeature( "http://xml.org/sax/features/namespaces",true );
    parser.setFeature( "http://apache.org/xml/features/validation/schema",true );
    parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking",true );
    Document document = parser.parse(cfgFileName);
    System.out.println("Vijay .. code .. damar\n");
    }catch (org.xml.sax.SAXParseException spe) {
    } catch (org.xml.sax.SAXNotRecognizedException ex ){
    } catch (org.xml.sax.SAXNotSupportedException ex ){
    } catch (org.xml.sax.SAXException se) {
    if (se.getException() != null)
    se.getException().printStackTrace(System.err);
    else
    se.printStackTrace(System.err);
    }catch (Exception e) {
    System.out.println("Caught unknown exception : \n");
    e.printStackTrace(System.err);
    System.out.println("Vijay .. code .. success\n");
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    //docBuilder.setErrorHandler(myErrorHandler);
    cfg = docBuilder.parse(new File(cfgFileName));
    cfg .getDocumentElement ().normalize ();
    } catch (Exception e) {
    e.printStackTrace();
    In the above code I am parsing the xml file and i am doing schema validation. Schema validation is proper and it is validating correctly. Only problem is that, It is validating and showing error correctly correctly but it is not catching that error.
    For clear understanding I am printing one statement before parsing and after parsing.
    SYSTEM.OUT.PRINTLN("Vijay .. code .. damar\n") this is before parsing
    SYSTEM.OUT.PRINTLN("Vijay .. code .. success\n") this is after parsing
    Here what is happening means, It is validating correctly and showing error :
    [Error] nw_layout-new.xml:800:97: Datatype error: Value 'y' does not match regular expression facet 'yes|no'..
    Vijay .. code .. damar
    Vijay .. code .. success
    Here it is showing error and still continueing not catching.
    Plz give solution for this.
    Thanks
    vijay K

    Hello dipthebe,
    Check out the articles below go through troubleshooting steps for your iPhone when the screen is unresponsive. You may want to try and restore your iPhone as a new device and then test out what happens when you miss a call to see if the issue is still present afterwards.
    iPhone, iPad, iPod touch: Troubleshooting touchscreen response
    http://support.apple.com/kb/ts1827
    Use iTunes to restore your iOS device to factory settings
    http://support.apple.com/kb/HT1414
    Regards,
    -Norm G.

  • Generate Adobe Interactive Form with XML Schema-Based Interface

    Hi,
    I need to generate a adobe Interactive but with XML Schema-Based Interface, i have one example but with ABAP Dictionary-Based Interface.
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        ie_outputparams       = fp_outputparams
    * EXCEPTIONS
    *   CANCEL                = 1
    *   USAGE_ERROR           = 2
    *   SYSTEM_ERROR          = 3
    *   INTERNAL_ERROR        = 4
    *   OTHERS                = 5
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
      EXPORTING
        i_name     = 'ZMMDM_CL'
      IMPORTING
        e_funcname = fm_name.
    But when i call the next function for print i need the docxml parameter and i don't know how to get it
    fm_name
    CALL FUNCTION fm_name
      EXPORTING
       /1BCDWB/DOCPARAMS        = fp_docparams
    *    /1bcdwb/docxml           =
    * IMPORTING
    *   /1BCDWB/FORMOUTPUT       =
    * EXCEPTIONS
    *   USAGE_ERROR              = 1
    *   SYSTEM_ERROR             = 2
    *   INTERNAL_ERROR           = 3
    *   OTHERS                   = 4

    1) this questions was asked many times before, you didn´t search for a second
    2) I am not aware of any standard solution
    3) custom solution: use XSLT transformation ID to get XML from the filled DDIC structure and use string operations to add the header and footer to create a valid XML.
    Regards Otto

  • Help needed with XML Schema Processor sample

    I'm trying to run the sample that came with the Oracle XML Schema Processor (XSDSample.java) and get the following error:
    -- process file: catalogue.xml
    file:/D:/java/xml/ORACLE/XSD/catalogue.xml<Line 8, Column 32>: XSD-2001: (Error) Can not create instance of: 'oracle.xml.parser.schema.XSDBuilder'
    What am I doing wrong. I am running the sample unchanged.
    thx,
    e
    null

    Looks like unzipping the jar and making sure its in your classpath fixed the problem. not sure why explicitly having the xschema.jar in the classpath didn't work.
    e

  • Dynamic tables with XML schema binding

    Hello,
    I'm currently fighting a strange issue dealing with a complex dynamic form. This form contains multiple dynamic tables to which the user may add new lines or delete lines that are no longer needed. This is being implemented using the instanceManager and works just fine.
    However, if I try to bind XML based data to this table, it looks like if rows added by the instance manager are always bound to the same record (they all contain identical values). The XML schema is correct, the issue also happens with sample XML data files.
    This seems to have something to do with the programatically added lines, but I have run out of ideas ... Can anyone provide some pointers?
    Thanks a million,
    Steffen.

    Thanks for the reply, Paul.
    I have the question about the schema,
    say i have a table like this:
    Item | Cost
    A   | 10.3
    B   | 21.1
    Total| 31.4
    and my schema is:
    so when I bind the table row should it be $.ItemTable[*].Item ?

  • Validating with XML Schemas

    Has anyone been successful at validating xml with a Schema running weblogic 6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema", "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)), A_HANDLER);
    When my xml code runs through the parser I get an error for each element saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

    I figured out my problem in case anyone else is having trouble..
    In the xml document that you need to refer to:
    xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance that is the namespace
    supported by xerces 1.3.1.
    Whew!
    "Karen Schaper" <[email protected]> wrote:
    >
    Has anyone been successful at validating xml with a Schema running weblogic
    6.1
    sp2?
    Here is a snippet of code...
    SAXParserFactory objFactory = SAXParserFactory.newInstance();
    objFactory.setValidating("true");
    objFactory.setNamespaceAware("true");
    objFactory.setFeature("http://apache.org/xml/features/validation/schema",
    "true");
    objXMLInputParser.parse(new InputSource(new StringReader(XMLDocument)),
    A_HANDLER);
    When my xml code runs through the parser I get an error for each element
    saying
    the element type is not declared in the dtd or schema.
    Since weblogic 6.1 runs with 1.3.1 Xerces parser. Does it support xml
    validation
    with a Schema. From what I've read it seems that it does.
    Any help or insight would be appreciated.
    Thanks
    Karen

  • Validation with XML Schema

    With the Xerces parser, you can validate an XML document against an XML schema. But what I wanted to do is something different.
    I want to validate data before they are put in XML. Like this:
    1) I have a set of class/classes that act as helper class(es) that creates an XML document that conforms to a specific XML Schema. The class(es) would have, of course, setXXXX() methods in it. The XML document is not created until someone call create().
    2) With each setXXXXX() method call, I know that the setXXXXX() would eventually map to a specific attribute in a specific element in the XML document that will be created.
    3) Therefore, I would want to be able to throw an Exception if a developer call setXXXX() with the correct Java data type, but with an incorrect value based on the XML Schema .... instead of throwing the error when the XML is being serialized / created by the XML parser in the create() method.
    Any ideas on how to do this?
    Regards,
    John

    The only way that I could think to do this is to have
    a lot of XSDs, one for each element essentially.
    In this case you'd have to build your mini-XMLs, parse
    each one with an XSD, and then report the error.
    Why do you want to do it this way? Is it because you
    want to know exactly which one gave an error without
    having to parse through the sometimes cryptic error
    messages?
    PaulYes. that's one.
    The other is, if you think of a form that is being filled by a user, you would want the user to be informed of which field in the form has the incorrect value, instead of just showing a generic message .... after which the user may get fed up and do his business elsewhere. Not good for business, isn't it?

  • XML: VALIDATING WITH XML SCHEMA: SAXNotRecognizedException

    Hi,
    1. From The Java� Web Services Tutorial for SAX
    If the parser is not 1.2 compliant, and therefore does not support XML Schema,it could throw a SAXNotRecognizedException .
    SAXParser saxParser =factory.newSAXParser();
    try {
    saxParser.setProperty(JAXP_SCHEMA_LANGUAGE,W3C_XML_SCHEMA);
    catch (SAXNotRecognizedException x){
    //Happens if the parser does not support JAXP 1.2
    2. How do we know if the parser is not 1.2 compliant or not? 1M Thanks.

    If you have an older xerces.jar in your class path your parser will not be JAXP 1.2 compliant.
    Try replacing xerces.jar with both xercesImpl.jar and xml-apis.jar.

  • Xml validation with xml schema

    Hi
    I want to do the validation of a xml file against the XML schema.How can i do that.
    As per jaxp we can do the validation of an xml file against DTD ,CAN we do the validation against XMLschema in a same way.
    Please help its urgent.
    regards
    prateek

    if you're using the Xerces parser, you def. can.
    if u look at the SAXCount example, you'll see a certain amount of attributes are set to true/false.
    one of these is Schema validation. set it to true, run the SAXCount.java example, and your XML is validated against it's XML Schema,

  • Mapping problem with XML scheme

    Hi All,
    I have a scenario which I am trying to send a XML file through SFTP (Advanco) to a Z RFC.
    I created the message mapping, but I am dealing with a issue that I would like to see if it already happened with someone else and which is the best way to solve it.
    In the message mapping - test tab - source view we can find this xml tag regarding the messagetype (see that my MT is called ROOT)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ROOT xmlns:ns0="http://www.post.ch/schemas/dfu/2006/20/Report6">
    the problem is, when I am testing the interface the original file comes like this below
    <?xml version="1.0" encoding="UTF-8"?>
    <ROOT xmlns="http://www.post.ch/schemas/dfu/2006/20/Report6">
    without ns0:
    And if I test in message mapping without ns0: I have the problem.
    Shouldnt it be equivalent ? I mean, as far as I know the ns0: shouldnt be a problem
    Does someone have any suggestion regarding my issue above ?
    Thank you
    Regards
    Diego
    Edited by: Diego Crespo on Feb 10, 2011 10:01 AM

    Shouldnt it be equivalent ? I mean, as far as I know the ns0: shouldnt be a problem
    when you have a namespace in the message then you need to associate it with some prefix....since ns0 (or any other prefix) is not present you are getting the error....having the namespace but not ns0 is the problem.
    XMLAnonymizer bean may help you to add the namespace prefix...

Maybe you are looking for

  • How can I delete all duplicate frames in a clip?

    I'm working with footage captured from a game engine on a Mac.  When the graphics processing get's intense the graphics card struggles to keep up.  What ends up happening is that the card continues to output every frame (e.g., it does not skip frames

  • Muse keeps crashing when embedding html vimeo

    I am on a Macpro (mac OS 10.7.5). Using Muse 7.3. Whenever i try to embed a vimeo video by html insert, muse crashes constantly. Also trying the vimeo widget in the widget library keeps crashing Muse. When i try the youtube widget there is no crash.

  • My Iphone was stolen. I was wondering if I connect a new phone, if I can continue to track the old one?

    My phone is stolen. I need to know if by connecting a new phone to my cell number, if I will no longer be able to track my iphone. HELP

  • Forums error?

    I have pages set to 50, and on the second page PL/SQL i get an error on the 30th thread down, the thread is "track the qeries that accessed a particular object during a time period", in the reples column: " An error in the system has occurred. Please

  • Detect redirect from webservice

    Hi. I've got a Flex application which is connecting to data via .net webservices. On our server we have an authentication method which times out after an inactivity period and any further requests are redirected to a login page. Unfortunately then, w