XPath to xsd:element??

Hello all:
I'd like to use XPath to get all the nodes below that have the following tag "xsd:element ". Currently, I am using:
List nodes = doc.selectNodes("//xsd:element");It returns a list with 0 elements. Why? Is it possible to use XPath with xsd tags? (It works when I use simple tags)
Thanks in advance
Here is a snippet of the xml.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<xsd:sequence>
<xsd:element name="CATALOG_NAME" type="xsd:string" sql:field="CATALOG_NAME" minOccurs="0"/>
<xsd:element name="SCHEMA_NAME" type="xsd:string" sql:field="SCHEMA_NAME" minOccurs="0"/>
<xsd:element name="CUBE_NAME" type="xsd:string" sql:field="CUBE_NAME" minOccurs="0"/>
<xsd:element name="SET_NAME" type="xsd:string" sql:field="SET_NAME" minOccurs="0"/>
<xsd:element name="SCOPE" type="xsd:int" sql:field="SCOPE"/>
<xsd:element name="DESCRIPTION" type="xsd:string" sql:field="DESCRIPTION" minOccurs="0"/>
<xsd:element name="EXPRESSION" type="xsd:string" sql:field="EXPRESSION" minOccurs="0"/>
<xsd:element name="DIMENSIONS" type="xsd:string" sql:field="DIMENSIONS" minOccurs="0"/>
</xsd:sequence></xsd:complexType></xsd:schema>
<row>

You need to specify the namespace context somewhere before you execute that line of code. Remember that when you use namespaces, the prefix is just a short cut that identifies the actual namespace URI, and you always have to tell the processing software how to map the prefix to the namespace URI.
In a full XML document you declare it like this:xml:xsd="somehorriblelongstring"but in an XPath expression you have to declare it in some other way. Look for methods that create namespace context and apply it to XPath somehow.

Similar Messages

  • How to use one xsd element in another xsd

    Hi,
    I have an xml as follows.
    <rss version="2.0" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V1/AnnotatedMaps.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="newtest.xsd">
    <!--Locator Version 1.4.0.0-->
    <channel>
    <title>Locations</title>
    <link>http://mytestlink.com</link>
    <description>location information</description>
    <item>
    <ymaps:Address>Roosevelt Blvd</ymaps:Address>
    <ymaps:CityState>Monroe, NC</ymaps:CityState>
    <ymaps:Zip>28112</ymaps:Zip>
    <ymaps:Country>US</ymaps:Country>
    </item>
    </channel>
    </rss>
    I worte an xsd as follows for the above xml
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V1/AnnotatedMaps.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xsd:element name="rss">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="channel">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="title" type="xsd:string" />
    <xsd:element name="link" type="xsd:string" />
    <xsd:element name="description" type="xsd:string" />
    <xsd:element ref="ymaps:Address" />
    <xsd:element ref="ymaps:CityState" />
    <xsd:element ref="ymaps:Zip" />
    <xsd:element ref="ymaps:Country" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="version" type="xsd:decimal" />
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    I am getting the below exception for that
    line numbner ---|13|---Column---|41|-----
    org.xml.sax.SAXParseException: src-resolve.4.2: Error resolving component 'ymaps:Address'. It was detected that 'ymaps:Address' is in namespace 'http://api.maps.yahoo.com/Maps/V1/AnnotatedMaps.xsd', but components from this namespace are not referenceable from schema document 'file:///E:/test/samples/newtest.xsd'. If this is the incorrect namespace, perhaps the prefix of 'ymaps:Address' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///E:/test/samples/newtest.xsd'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    Could any one help me?
    Thanks in advance
    Samba Damerla

    Hi Andrzej,
    please check out this thread: Set parameters values depending on other parameters
    I had a discussion about query results as input for another query in there.
    For creating a workbook, just click on the save button after you ran your query in the bex.
    Siggi
    Message was edited by: Siegfried Szameitat

  • Xsd:element ref not working with jaxb

    Hi,
    I'm trying to implement a simple web service based on jax-ws.
    My probem is that binding does not working when I use the <xsd:element ref="..."/> attribute in the schema description.
    Here is the web service implementation :
    @Stateless()
    @WebService(
    serviceName="AlarmBeanService",
    targetNamespace="http://two.one.net/jws/alarm/",
    endpointInterface="net.one.two.jws.alarm.AlarmBeanPortType")
    public class AlarmBean implements AlarmBeanPortType {
    public AlarmCreateOut persist(AlarmCreateIn in) {
    return new AlarmCreateOut();
    My AlarmCreateIn message is defined in AlarmCreateIn.xsd :
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:c="http://two.one.net/jws/alarm/schema/common/"
    targetNamespace="http://two.one.net/jws/alarm/schema/create/in/"
    elementFormDefault="unqualified"
    attributeFormDefault="unqualified">
    <xsd:import namespace="http://two.one.net/jws/alarm/schema/common/" schemaLocation="../common/AlarmDataTypes.xsd"/>
    <xsd:element name="AlarmCreateIn">
    <xsd:annotation>
    <xsd:documentation>
    </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="c:alarm" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    This way it's not working, my "alarm" object in AlarmCreateIn is always null.
    But it works if referencing my alarm object like in the following xsd :
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:alarm="http://two.one.net/jws/ctypes/alarm/"
         targetNamespace="http://two.one.net/jws/alarm/schema/create/in/"
         elementFormDefault="unqualified"
         attributeFormDefault="unqualified">
         <xsd:import namespace="http://two.one.net/jws/ctypes/alarm/" schemaLocation="../../ctypes/alarm/Alarm.xsd" />
         <xsd:element name="AlarmCreateIn">
              <xsd:annotation>
                   <xsd:documentation>
                   </xsd:documentation>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element name="alarm"      type="alarm:AlarmXsd"          minOccurs="0" />
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
    </xsd:schema>
    Any ideas on what happen?
    Thanks.
    Edited by will_mad at 07/24/2007 10:15 AM

    Most likely you chose the logical file instead of the correct file for the PSE editor. The one you can see, at the top level of the PSE 10 folder in Applications, is the welcome screen. The actual editor is hidden in the Support Files folder. You want this one:

  • Making XSD element name match the column name/header

    The XML format of the answer I created looks like the following. How can I change the element name from C0, C1... to real column name? http://host:port/analytics/saw.dll?Go&searchid provided the XML
    <?xml version="1.0" encoding="utf-8" ?>
    - <RS xmlns="urn:schemas-microsoft-com:xml-analysis:rowset">
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:saw-sql="urn:saw-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset">
    - <xsd:complexType name="R">
    - <xsd:sequence>
    <xsd:element name="C0" type="xsd:double" minOccurs="0" maxOccurs="1" saw-sql:type="double" saw-sql:displayFormula=""CUSTOMERS"."SALES"" saw-sql:aggregationRule="none" saw-sql:aggregationType="nonAgg" saw-sql:tableHeading="CUSTOMERS" saw-sql:columnHeading="SALES" />
    <xsd:element name="C1" type="xsd:string" minOccurs="0" maxOccurs="1" saw-sql:type="varchar" saw-sql:displayFormula=""CUSTOMERS"."CITY"" saw-sql:aggregationRule="none" saw-sql:aggregationType="nonAgg" saw-sql:tableHeading="CUSTOMERS" saw-sql:columnHeading="CITY" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    - <R>
    *<C0>0.3</C0>*
    *<C1>WILLITS</C1>*
    </R>
    Edited by: user732932 on Jan 7, 2010 11:38 AM

    OR is there a way to pass the column headers from OBIEE to a URL? For example, session parameters can be passed using @{parmName}

  • Undefined element "xsd:element"

    While trying to do this:
    declare doc varchar(10000) := '
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns="http://www.w3.org/2001/XMLSchema"     
    xmlns:xdb="http://www.oracle.com/"
         targetNamespace="http://www.books.org"
    elementFormDefault="qualified">
    <xsd:element name="BookStore" xdb:defaultTable="PROVA">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="Book" minOccurs="1" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Book">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="Title" minOccurs="1" maxOccurs="1"/>
    <xsd:element ref="Author" minOccurs="1" maxOccurs="1"/>
    <xsd:element ref="Date" minOccurs="1" maxOccurs="1"/>
    <xsd:element ref="ISBN" minOccurs="1" maxOccurs="1"/>
    <xsd:element ref="Publisher" minOccurs="1" maxOccurs="1"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Title" type="xsd:string"/>
    <xsd:element name="Author" type="xsd:string"/>
    <xsd:element name="Date" type="xsd:string"/>
    <xsd:element name="ISBN" type="xsd:string"/>
    <xsd:element name="Publisher" type="xsd:string"/>
    </xsd:schema>';
    begin
    dbms_xmlschema.registerSchema('http://www.oracle.com/PO.xsd', doc,TRUE, TRUE, FALSE, TRUE);
    end;
    I get this error:
    declare doc varchar(10000) := '
    ERRORE alla riga 1:
    ORA-31154: invalid XML document
    ORA-19202: Errore durante XML processing
    LSX-00021: undefined element "xsd:element"
    ORA-06512: a "XDB.DBMS_XMLSCHEMA_INT", line 0
    ORA-06512: a "XDB.DBMS_XMLSCHEMA", line 12
    ORA-06512: a line 38
    What does it mean? why is xsm:element undefined?
    Thanx

    Here it is.
    i did some modification in the header section of the schema and was able to register it.
    pls compare the two to see the difference.
    <xsd:schema targetNamespace="http://www.books.org/books.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.books.org/books.xsd" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified">
    <xsd:element name="BookStore" xdb:defaultTable="PROVA">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="Book" minOccurs="1" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Book">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="Title" minOccurs="1" maxOccurs="1"/>
    <xsd:element ref="Author" minOccurs="1" maxOccurs="1"/>
    <xsd:element ref="Date" minOccurs="1" maxOccurs="1"/>
    <xsd:element ref="ISBN" minOccurs="1" maxOccurs="1"/>
    <xsd:element ref="Publisher" minOccurs="1" maxOccurs="1"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Title" type="xsd:string"/>
    <xsd:element name="Author" type="xsd:string"/>
    <xsd:element name="Date" type="xsd:string"/>
    <xsd:element name="ISBN" type="xsd:string"/>
    <xsd:element name="Publisher" type="xsd:string"/>
    </xsd:schema>';
    begin
    dbms_xmlschema.registerSchema('http://www.oracle.com/PO.xsd', doc,TRUE, TRUE, FALSE, TRUE);
    end;

  • Issue in Conversion of String to XML (xsd) elements.

    Hi All,
    Please help in resolving the below issue.Please help me ASAP
    I am getting a strng value from Db adapter String= Mike,3453,USA
    I need to convert the data into xml by using below xsd.
    <?xml version="1.0" encoding='UTF-8' ?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.uss.com/htr/IHCM204/MainRec"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    xmlns:tns="http://www.uss.com/htr/IHCM204/MainRec"
    attributeFormDefault="unqualified" nxsd:version="NXSD"
    nxsd:stream="chars" nxsd:encoding="US-ASCII">
    <element name="MainOutput">
    <complexType>
    <sequence>
    <element name="Target" maxOccurs="unbounded">
    <complexType>
    <sequence>
    <element name="name" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <element name="sal" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <element name="add" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    </schema>
    Regards,
    Ana

    Say, for Example
    If you are getting response from db adapter as abc,def,ghi then use an transform activity to split the string.
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <xsl:template match="/">
    <ns:StringParsing>
    <ns:Name>
    <xsl:value-of select='substring(/ns:simpleelement/ns:dbString,1.0, oraext:last-index-within-string(/ns:simpleelement/ns:dbString,",") + 0.0)'/>
    </ns:Name>
    <ns:Address>
    <xsl:value-of select='substring(/ns:simpleelement/ns:dbString,oraext:last-index-within-string(/ns:simpleelement/ns:dbString,",") + 2.0)'/>
    </ns:Address>
    </ns:StringParsing>
    </xsl:template>
    </xsl:stylesheet>
    Let me know if it helps you.
    Edited by: BK574 on May 14, 2013 11:31 AM
    Edited by: BK574 on May 14, 2013 11:55 AM
    Edited by: BK574 on May 14, 2013 12:48 PM

  • WSDL incorrect - in XSD elements always must be the root element?

    Hi!
    First of all, sorry about my english, but I'm not accustomed to write in this language ;-)
    We're trying to publish a Webservice with JAXWS and with a classes generated via JAXB parsing a group of XSD files, always in a maven project with java 5.
    More explained the steps we are trying to follow:
    1) parse the XSD files with JAXB and generate a JAR file to be included like a dependency in the webapp
    2) use the classes packaged in the JAR in other maven project and define and deploy a webapp with the webservice using JAXWS defining a SEI that uses and returns a Type included in the JAR generated in the previous step. Here it is the interface that implements the SEI:
    @WebMethod
         public TESTELEMENT test(
                   @WebParam(name = "test")
                   TESTELEMENT element);The problem seems to be that if the elements in the original XSD files aren't root elements the WSDL generated is incorrect.
    Here there are the XSD files we are using and the WSDL error result (XMLSpy dixit, "ns1:Example" must refer to an existing element).
    Anyone knows what happens?
    Thank you in advance and sorry about this large message!
    +--- start of TEST.XSD --+
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.work/test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="TEST_TYPE.xsd"/>
    <!--
    if we define the Example Element like this, everything works ok! why? because Example is defined global?
    <xs:element name="Example" type="ExampleType"/>
    -->
    <xs:element name="TEST_ELEMENT">
    <xs:annotation>
    <xs:documentation>Blablabla</xs:documentation>
    </xs:annotation>
    <xs:complexType>
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Example" type="TestType"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>+-- end --+
    +--- start of TEST_TYPE.xsd --+
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.work/test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:complexType name="TestType">
    <xs:annotation>
    <xs:documentation>Example type</xs:documentation>
    </xs:annotation>
    <xs:sequence>
    <xs:element name="Element_A" type="xs:string"/>
    <xs:element name="Elment_B" type="xs:boolean"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>+-- end --+
    +-- start WSDL error --+
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions name="TestBO" targetNamespace="http://our.package.test/" xmlns:ns1="http://our.package.test/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:types>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://example.work/test" xmlns:tns="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="TEST_ELEMENT">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="Example" type="tns:TestType"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="TestType">
    <xs:sequence>
    <xs:element name="Element_A" type="xs:string"/>
    <xs:element name="Elment_B" type="xs:boolean"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://our.package.test" xmlns:ns1="http://example.work/test" xmlns:tns="http://our.package.test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://example.work/test"/>
    <xs:element name="test" type="tns:test"/>
    <xs:element name="testResponse" type="tns:testResponse"/>
    <xs:complexType name="test">
    <xs:sequence>
    <xs:element minOccurs="0" name="test">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns1:Example"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="testResponse">
    <xs:sequence>
    <xs:element minOccurs="0" name="return">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns1:Example"/> *<!-- here is the error - XMLSpy dixit that ns1:Example must refer to an existing element -->*
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    </wsdl:types>
    <wsdl:message name="test">
    <wsdl:part element="ns1:test" name="parameters">
    </wsdl:part>
    </wsdl:message>
    <wsdl:message name="testResponse">
    <wsdl:part element="ns1:testResponse" name="parameters">
    </wsdl:part>
    </wsdl:message>
    <wsdl:portType name="TestBO">
    <wsdl:operation name="test">
    <wsdl:input message="ns1:test" name="test">
    </wsdl:input>
    <wsdl:output message="ns1:testResponse" name="testResponse">
    </wsdl:output>
    </wsdl:operation>
    </wsdl:portType>
    </wsdl:definitions>+-- end --+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi again.
    About my last post, say that the WSDL generated, in fact, was generated with CXF, sorry.
    Using JAXWS (wsgen to be more explicit) the WSDL results still are not ok, as you can see, the error is in the last ns1:Example reference in ServeiTestBO_schema1.xsd, that XMLSpy says that doesn't exists :-( :
    +--- ServeiTestBOImplService.wsdl [ServeiTestBOImpl - SEI] ---+
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.5-b03-. -->
    <definitions targetNamespace="http://impl.our.package.test/" name="ServeiTestBOImplService" xmlns:tns="http://impl.our.package.test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
      <import namespace="http://our.package.test/" location="ServeiTestBO.wsdl"/>
      <binding name="ServeiTestBOImplPortBinding" type="ns1:ServeiTestBO" xmlns:ns1="http://our.package.test/">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <operation name="test">
          <soap:operation soapAction=""/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="ServeiTestBOImplService">
        <port name="ServeiTestBOImplPort" binding="tns:ServeiTestBOImplPortBinding">
          <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
        </port>
      </service>
    </definitions>+--- ServeiTestBO.wsdl [SEI interface] ---+
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.5-b03-. -->
    <definitions targetNamespace="http://our.package.test/" xmlns:tns="http://our.package.test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
      <types>
        <xsd:schema>
          <xsd:import namespace="http://our.package.test/" schemaLocation="ServeiTestBO_schema1.xsd"/>
        </xsd:schema>
        <xsd:schema>
          <xsd:import namespace="http://example.work/test" schemaLocation="ServeiTestBO_schema2.xsd"/>
        </xsd:schema>
      </types>
      <message name="test">
        <part name="parameters" element="tns:test"/>
      </message>
      <message name="testResponse">
        <part name="parameters" element="tns:testResponse"/>
      </message>
      <portType name="ServeiTestBO">
        <operation name="test">
          <input message="tns:test"/>
          <output message="tns:testResponse"/>
        </operation>
      </portType>
    </definitions>+--- ServeiTestBO_schema1.xsd *[with error in the last "ns1:Example"]* ---+
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema version="1.0" targetNamespace="http://our.package.test/" xmlns:tns="http://our.package.test/" xmlns:ns1="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import namespace="http://example.work/test" schemaLocation="ServeiTestBO_schema2.xsd"/>
      <xs:element name="test" type="tns:test"/>
      <xs:element name="testResponse" type="tns:testResponse"/>
      <xs:complexType name="test">
        <xs:sequence>
          <xs:element name="test" minOccurs="0">
            <xs:complexType>
              <xs:sequence>
                <xs:element ref="ns1:Example" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="testResponse">
        <xs:sequence>
          <xs:element name="return" minOccurs="0">
            <xs:complexType>
              <xs:sequence>
                <xs:element ref="ns1:Example" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    --- ServeiTestBO_schema2.xsd  ---
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema elementFormDefault="qualified" version="1.0" targetNamespace="http://example.work/test" xmlns:tns="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="TEST_ELEMENT">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Example" type="tns:TestType" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="TestType">
        <xs:sequence>
          <xs:element name="Element_A" type="xs:string"/>
          <xs:element name="Elment_B" type="xs:boolean"/>
          <xs:element name="Sex" type="tns:SexType"/>
        </xs:sequence>
      </xs:complexType>
      <xs:simpleType name="SexType">
        <xs:restriction base="xs:string">
          <xs:enumeration value="M"/>
          <xs:enumeration value="W"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:schema>Thanks in advance again.

  • XPath expression to element with xsl: namespace

    Hi,
    I have a problem selecting a node in an XSL document. What I'm trying to do is to load an XSL file and change the 'select' attribute of <xsl:for-each select='//whatever'>
    I tried it something like this:
    Node articleSelect = XPathAPI.selectSingleNode(xslDOM, "//for-each");
    articleSelect.getAttributes().getNamedItem("select").setNodeValue("//article[@ArticleNr='" + articleNumber + "']");However, articleSelect is always null so the second line throws an exception. I also tried "//xsl:for-each" and "//xsl:for-each[@select='//whatever']" and whatnot as the XPath expression, but still no luck... :(
    Any thoughts or ideas will be greatly appreciated :)
    Greetings,
    Erik

    Erik, your code is working fine but you must ensure that the document builder used to create xslDOM has nameSpaceAware = true!
    May I suggest this rewriting - not necessary - but more clear I think:
    Element articleSelect = (Element) XPathAPI.selectSingleNode(xslDOM, "//xsl:for-each");
    articleSelect.setAttribute("select", "//article[@ArticleNr='" + articleNumber + "']");

  • External Definition (wsdl) with abstract xsd element

    Hello All,
    we are trying to call a webservice, here is the wsdl:
    https://www.1link.com/fr/demo-sn/site/gaiwebservice.asmx?WSDL
    the problem is that the GAIJobLine element is defined as abstract:
    <s:complexType name="GAIJobLine" abstract="true">
    and there several elements which are extending GAIJobLine, for example:
    <s:complexType name="GAITyreLine">
                        <s:complexContent mixed="false">
                             <s:extension base="tns:GAIJobLine">
    So in our mapping we need to map to those element which are extending base element and not to the abstract one, but Graphical mapping displays only GAIJobLIne base element.
    Does anybody know how we can map to extended elements without mannually changing wsdl?
    Best Regards,
    Artsiom Anichenka

    thanks for your reply!
    the extended elements are seen when I open wsdl in XMLSpy.
    they are also visible in external definition object, but the main problem is that in the mapping only the base lement is displayed and there is no possobility to choose the extension.
    Maybe this kind os XSDs (with abstract base types and extended elements) are just not supported by PI711?

  • Id and name attributes on xsd elements

    id, and name attributes on elements do not have a defined length, correct?
    We are shredding an xml document into storage, currently we assign 255 characters for the field that will persist the values, since the id/name fields can be longer than this is there a best practice hat is recommended for xml authors not to create ids, and names with a long string.
    I am working in a specialization of xml called XBRL,
    Neil

    Per the W3C standards, as I read them, you are correct. There is no limit on how long the attribute name (http://www.w3.org/TR/2008/REC-xml-20081126/#attdecls) can be. Follow the Name link on that page and you'll see a Name is defined as NameStartChar (NameChar)*, which is unbounded in length.
    What various tools, including Oracle implement, for max name lengths is not known to me but your 255 seems more than reasonable. The best practice in terms of node name length depends upon who created the schema and what pattern they followed.
    For example, this ISO standard
    ISO/IEC 11179-5:2005, Information technology — Metadata registries (MDR) — Part 5: Naming and identification principles. Available from
    http://standards.iso.org/ittf/PubliclyAvailableStandards/c035347_ISO_IEC_11179-5_2005(E).zip.
    is used by NIEM but neither it nor additional NIEM restrictions put a max length on node names.
    I've played around some with XBRL too and while I've seen a few long ones, I don't think they were over 50 characters so 255 would be more than enough. You could play around with all the .xsd schemas they have and look to see what the longest node name is and then set your length just over that but 255 is more than plenty in my opinion.

  • XSD elements problem

    Hi Guru's,
    I am working with SAP PI 7.0 and when I upload an XSD to PI I can see the following structure:
         <xs:element name="fields">
              <xs:complexType>
                   <xs:attribute name="Field1" type="xs:string" use="required"/>
                   <xs:attribute name="Field2" type="xs:string" use="required"/>
                   <xs:attribute name="Field3" type="xs:string"/>
              </xs:complexType>
         </xs:element>
    When I look in the message mapping in the repository I see that field 2 and field 3 has changed position, so in message mapping it's via the following sequence:
    <xs:attribute name="Field1" type="xs:string" use="required"/>
    <xs:attribute name="Field3" type="xs:string"/>
    <xs:attribute name="Field2" type="xs:string" use="required"/>
    How can this be?
    Best regards,
    Guido Koopmann

    I discussed this with a developer from SAP some times ago.
    When the XSD does not have a "sequence" tag, PI picks up the elements and attributes randomly.
    In principle an XML parser should not make a difference, in which order the attributes come.
    To avoid this behaviour, you have to add a sequence node:
    <xsd:complexType>
                   <xsd:sequence>
                      <xs:attribute name="Field1" type="xs:string" use="required"/>
                      <xs:attribute name="Field2" type="xs:string" use="required"/>
                      <xs:attribute name="Field3" type="xs:string"/>
                   </xsd:sequence>
                </xsd:complexType>

  • XPath to select elements with specific namespace attribute?

    To select all elements with a specific attribute, i can use
    //*[attribute::val1='true']for elements that look like
    <Name val1="true">hello</Name>But how can i select them, if the attribute has a namespace:
    <Name myns:val1="true">hello</Name>?

    If JDOM is used to parse a node with XPath, node namespace should be added to the XPath.
    XPath xpath=XPath.newInstance("/@myns:val1='true');                
      xpath.addNamespace("myns", "http://www.w3.org/2001/XMLSchema-Instance");

  • XSD Element Associations

    Hi All,
    I have XSD and I want to capture relation between the Elements.Some thing like there is Element Name:*Bank* and another element Name:*Person* so there is a association between them with Account Number.
    Is some tool is there which can show this type of association in diagrams some thing like Class diagrams where we can see the arrows from one class to another class.

    It is not possible. Though the <any> element would permit the occurrence of elements with any name, it is not possible to specify rules on the attributes of these elements.

  • XPath accessing href element

    I'm invoking a webservice using a Service callout.
    The webservice replies with the SOAP response properly. In the response, there is an element that has an internal href.
    The issue is: I can't find any way of accessing via XPtah the element that has the href.
    For example:
    $responseCallout/pp:getAccountDetailsResponse/Result doesn't return the content of #id0.
    PS: i mapped properly the pp prefix.
    Is there any way of accessing the href content?
    $responseCallout has the following value returned by the service callout:
    <soap:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns5="http://www.test.com/package/com.test.returns/">
    <n:getAccountDetailsResponse xmlns:n="http://tempuri.org/AccountUpgradeImpl">
    <Result href="#id0"/>
    </n:getAccountDetailsResponse>
    <id0 id="id0" soapenc:root="0" xsi:type="ns5:AccountDetailsReturn">
    <returnCode xsi:type="xsd:int">100</returnCode>
    <returnMessage xsi:type="xsd:string">SUCCESS</returnMessage>
    </id0>
    </soap:Body>
    Regards,
    Fabio Douek
    Edited by fdouek2 at 09/27/2007 3:31 AM

    Hi Gregory,
    This will return "#id0". I would like to retrieve the content. It should have a mechanism to retrieve it automatically. I mean, I shouldn't be aware the fact that the SOAP response is using href. If I reference it straight, and at some stage the backend changes the references, it will break everything...
    Regards,
    Fabio.

  • Assign ora:getCompositeInstanceId() in the xsd element

    I need to assign BPEL process id, ora:getCompositeInstanceId(), to one of element in the xsd. Is this function available in the Transformation mapping so that I can assign to the element? I found the function in the mediator functions but I didn't work in the BPEL. Any of your idea will be appreciated.
    SOA: 11.1.1.6

    It works in BPEL, it is available as part of Advanced Functions in Expression Builder. However, it does not in Transformations(XSLT). So to work around two alternatives can be used
    Alternate 1:
    - Create a temp variable like "varCompositeInstanceId".
    - Create a assign activity, before the transformation, set the value of the variable to "ora:getCompositeInstanceId()" inside this Assign activity.
    - Send the variable as a parameter to the transformation.
    - Use the parameter to map to the target inside the transformation(XSLT).
    Alternate 2:
    - Set the target in the XSLT to some random text.
    - After the transformation, add an assign activity and inside it, set the value of the taget to "ora:getCompositeInstanceId()".
    Mark the posting appropriately as "helpful" or "correct answer", if your issue is resolved.

Maybe you are looking for