IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Problems with creating DocumentType from XML schema containing xml:lang

  • 1.  Problems with creating DocumentType from XML schema containing xml:lang

    Posted Thu April 09, 2009 02:06 PM

    Hallo wmUsers!

    I have a problem with importing an XML-schema, which contains an attribute reference to xml:lang.

    The schema looks as follows (basically):

    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema 
    xmlns="http://xyz.com/Examp" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    targetNamespace="http://xyz.com/Examp"
    elementFormDefault="qualified">
    
    <xs:import namespace="http://www.w3.org/XML/1998/namespace"/> <!-- ** -->
    
    <xs:element name="Examp">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Text">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute ref="xml:lang" use="required"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    So a valid XML document would look like

    <?xml version="1.0" encoding="UTF-8"?>
    <Examp xmlns="http://xyz.com/Examp">
    <Text xml:lang="en-us">Hello space!</Text>
    </Examp>

    Now, if I want to create a DocumentType from that schema, (after quite some waiting) the Developer throws the error:

    Success: false
    
    Error: 0
    identifier: /schema/element[@name="Examp"]
    
    source: -----   Source   -----
    <xs:attribute ref="xml:lang" use="required"/>
    
    errorMessage: [ISC.0082.9706] Declaration not found

    What could be the problem here and how could I solve it, so that I can at the successfully validate an XML document containing the xml:lang attribute?

    Thx, Christoph

    PS:
    I also tried modifying the schema, with the import-line looking as follows:

    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>

    or

    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="C:\xml\Schema\xml.xsd"/>

    or
    by even leaving the import-line away.

    But none of it worked.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services