webMethods

webMethods

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
Expand all | Collapse all

Importing schema for xml:lang, etc.

  • 1.  Importing schema for xml:lang, etc.

    Posted Tue December 01, 2009 10:40 AM

    Hi all,
    for a multilingual application I need to specify the lang attribute for many elements. To do this I want to import the xml:lang attribute in the schema, which poses a problem for me. Here is the verbose description of the problem:

    The typical procedure for defining xml-predefined attributes is to use import in the xsd/tsd:

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

    The elements in the XSD are then defined with the additional attribute xml:lang by:

        <xs:attribute ref="xml:lang"/>

    Afterwards I should be able to use elements with the xml:lang attribute, for example

      
    <langSet xml:lang="en"> 

    I understand that I need to specify the xml.xsd and safe it within Tamino (in this case we run Tamino 8.0 ) because Tamino does not resolve the namespace as such from the URL. But when I define a simple xsd

     
    <?xml version = "1.0" encoding = "UTF-8"?> 
    <xs:schema targetNamespace = "http://www.w3.org/XML/199 /namespace"  elementFormDefault = "qualified"  
    xmlns:tsd = "http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition"  
    xmlns:xs = "http://www.w3.org/2001/XMLSchema"> 
    
    <xs:annotation> 
    <xs:appinfo> 
    <tsd:schemaInfo name = ""> 
    <tsd:collection name = ""></tsd:collection> 
    </tsd:schemaInfo> 
    </xs:appinfo> 
    </xs:annotation> 
    <xs:attribute name = "lang"></xs:attribute> 
    </xs:schema> 
    

    I receive an error when validating it against Tamino (from within the Tamino Schema-Editor)

    [1:300] invalid prefix bound to URI 'http://www.w3.org/XML/1998/namespace' only 'xml' allowed.<INOXDE7703,INOXDE7786>

    Needless to say that the Oxygen-XML editor tells me that the schema and the imported schema are valid, the instance as well. And the 1:300 (first line column 300 does not even exist) does not help either.

    I seem to remember to have seen and used a solution to this problem.
    Any ideas are appreciated. Maybe someone knows the reference in the documentation; I seem to overlook it, though I am positive to having seen a solution before.

    Greetings
    Thorsten


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: Importing schema for xml:lang, etc.

    Posted Tue December 01, 2009 02:01 PM

    Hi all,

    I found the solution, which is extremely easy, but just in case you have a similar problem:
    you only need

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

    Do not provide a schemaLocation, this schema is predefined in Tamino. I do not have a reference, but I just applied it and it worked :slight_smile:
    In case you parse your schema outside of Tamino with another tool, this tool might complain about not finding the xml.xsd, just ignore it :slight_smile:

    Thorsten


    #Tamino
    #API-Management
    #webMethods


  • 3.  RE: Importing schema for xml:lang, etc.

    Posted Tue December 01, 2009 05:32 PM

    If you want to supply the location for Tamino, it’s “…/ino:collection/xml_lang_space


    #webMethods
    #Tamino
    #API-Management