GetXMLSchema java method generates invalid XML Schema document

Hi all,
I managed to get the xdk FAQ demo to work eventually on oracle 9.2.0.1.0 for windows, I noticed however that when I generate an XML Schema definition against a query, the document contains an outdated namespace declaration (minor flaw) and "nullable" attributes instead of "nillable", resulting in an invalid XML Schema document when edited with certain tools like Altova's XmlSpy.
How can I fix this?
See below for the XML Schema source.
Bye,
Flavio
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
<xsd:element name="ROWSET">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ROW" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CATEGORY" type="xsd:string" minOccurs="0"/>
<xsd:element name="QUESTION" type="xsd:string" minOccurs="0"/>
<xsd:element name="ANSWER" type="xsd:string" minOccurs="0"/>
<xsd:element name="LANGUAGE" type="xsd:string" minOccurs="0"/>
<xsd:element name="SENDBY" type="xsd:string" nullable="true" minOccurs="0"/>
<xsd:element name="CREATETIME" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="num" type="xsd:integer"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

With my (trial) copy of XMLSPY (version 2004 rel.3), I get following pop-up when opening that schema:
"This schema is written in an old standard:
http://www.w3.org/2000/10/XMLSchema
Do you want XMLSPY to convert it to the new one:
http://www.w3.org/2001/XMLSchema"
When I click "Yes" and save, I get a perfectly valid schema (with nullable replaced by nillable).

Similar Messages

  • WE60 - Error while generating the xml schema

    Hi
    Using the transaction WE60 I am trying to generate an XML schema for the BASIC type : DEBMDM06, Segment release - 7 and record type version - 3. Following error message is displayed. "Structure of segment E1T023W is unknown". Kindly let me know how to generate an XML schema successfully and what is the reason for this error to come up
    Regards
    Aruna

    Hi Aruna,
    It seems a dictionary error but it doesn't occurs to me. I can download the XML schema without problems in SAP ECC 6.0.
    If you let me know your email I can send it zipped to you.
    Reward points if helps.
    Roger

  • Generating an XML schema for a TABLE

    Hi,
    I know I can easily export DATA into an XML file, but Sql Developer can also generate an XML schema for a table LAYOUT. Does anyone know how this is done?
    I did it some time ago and have been unable to do it again.
    Thanks

    Hi Thanks for the response. Yes, what you say is the type of thing I mean. The snippet below was actually created using SqlDeveloper, but I just can't seem to be able to do it again :-(
    <?xml version='1.0' encoding='Cp1252' ?>
    <results>
         <row>
              <Column_Name><![CDATA[AD_UNIT_ID]]></Column_Name>
              <Data_Type><![CDATA[NUMBER(5,0)]]></Data_Type>
              <Nullable><![CDATA[Yes]]></Nullable>
              <Data_Default><![CDATA[]]></Data_Default>
              <COLUMN_ID><![CDATA[1]]></COLUMN_ID>
              <Primary_Key><![CDATA[]]></Primary_Key>
              <COMMENTS><![CDATA[]]></COMMENTS>
         </row>
         <row>
              <Column_Name><![CDATA[AD_UNIT_NAME]]></Column_Name>
              <Data_Type><![CDATA[CHAR(30 CHAR)]]></Data_Type>
              <Nullable><![CDATA[Yes]]></Nullable>
              <Data_Default><![CDATA[]]></Data_Default>
              <COLUMN_ID><![CDATA[2]]></COLUMN_ID>
              <Primary_Key><![CDATA[]]></Primary_Key>
              <COMMENTS><![CDATA[]]></COMMENTS>

  • SQL Developer generating an XML Schema for a table

    I hope I've put this question in to correct area of the forum!
    My question is how do you generate an XML schema of a table layout in SQL Developer?
    You can generate an XML schema for the DATA, but I just want to generate one with all the column definitions etc.
    The annoying thing is I managed to do this the other day, but after attempting again for several hours I've forgotten how to do it :-(
    Thanks and regards, Adrian

    A more specific answer, using SqlDeveloper itself, can be found at
    Re: Generating an XML schema for a TABLE

  • Java Stored Procedure SAXParser XML Schema Validation

    Using Oracle XML Developers Kit 10.2.0.2.0 - Production.
    Attempting to validate using XML Schema in a Java stored procedure with the code:
                   if ( schemaDoc == null )
                        // Obtain default connection
                        Connection conn = new OracleDriver().defaultConnection();
                        OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement("SELECT XmlDocObj FROM XmlDoc WHERE XmlDocNbr = 2");
                        OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
                        if ( rset.next() )
                             // get the XMLType
                             XMLType schemaXml = (XMLType)rset.getObject(1);
                             XSDBuilder builder = new XSDBuilder();
                             XMLSchema schemaDoc = (XMLSchema)builder.build(new InputSource(schemaXml.getInputStream()));
                   if ( inst == null )
                        inst = new ValidateCoreRequest();
                   ErrorHandlerImpl handler = inst.getNewErrorHandler();
    SAXParser saxParser = new SAXParser();
    saxParser.setXMLSchema(schemaDoc);
    saxParser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    saxParser.setErrorHandler(handler);
    saxParser.parse(new InputSource(new StringReader(docStr)));
    if( handler.validationError )
                        errorMsg[0] = handler.saxParseException.getMessage().substring(0, Math.min(199, handler.saxParseException.getMessage().length()));
    Never reports validation errors in the XML. Although the XDK Programmers Guide states "...you can use
    the oracle.xml.parser.schema.XSDBuilder class to build an XML schema and
    then configure the parser to use it by invoking the XMLParser.setXMLSchema()
    method. In this case, the XML parser automatically sets the validation mode to
    SCHEMA_STRICT_VALIDATION and ignores the schemaLocation and
    noNamespaceSchemaLocation attributes." No validation seems to occur. I have tried to set an xsi:noNamespaceSchemaLocation attribute on the root XML node, but this results in URL errors if the URL is not valid or schema build errors if the URL is valid, but does not point to a real location.
    It appears that without a schema location attribute, no schema validation occurs. Using setXMLSchema() with a database source does not seem to cause the schema location attributes to be ignored. At least for Java stored procedures.
    Does XML Schema validation work in the database for externally referenced schemas?
    Thank You,
    Art

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jan Vissers ([email protected]):
    I have two schemas A and B. A contains a java stored procedure which calls a java stored procedure stored in B. Upon resolving the "A" Java Stored Procedures I get the following error:
    ORA-29545: badly formed class: at offset 3093 of Adapter.TFADPBeschikbaarheid.sendAanvraag expecting a class-oracle.xml.parser.v2.XMLDocument but encountered a class-oracle.xml.parser.v2.XMLDocument.
    ... Question:
    it is expecting something which it has in fact encountered... SO!!!! What is the error.
    Thx,
    Jan<HR></BLOCKQUOTE>
    Try this:
    Edit your XSU installation script located on lib directory of Oracle XSU's distribution:
    Find the line:
    loadjava -r -v -u $USER_PASSWORD xmlparserv2.jar
    Replace by:
    loadjava -r -v -g public -u $USER_PASSWORD xmlparserv2.jar
    And installs your Oracle XSU again.
    Best regards, Marcelo.

  • Generate + register xml schema

    Hi,
    I want to generate and register an xml schema based on the following object type :
    CREATE TYPE STRAAT_T AS OBJECT
    naam varchar2(50),
    prv_cd number(1),
    arr_cd number(1),
    gem_cd number(3)
    I ran the following pl/sql code :
    begin
    dbms_xmlschema.registerSchema(schemaURL=>'http://www.oracle.com/straat.xsd',
    schemaDoc=>dbms_xmlschema.generateschema('TEST_RKW','STRAAT_T'));
    end;
    but got the following error code :
    .ORA-31094: Incompatible SQL-type "STRAAT_T" for attribute of element "STRAAT_T".
    What is wrong with this ???
    tx for any help.

    Roger
    Since the Type already exists you need to pass the value 'FALSE', as the fourth argument to registerSchema().
    Eg
    CREATE or replace TYPE STRAAT_T AS OBJECT
    naam varchar2(50),
    prv_cd number(1),
    arr_cd number(1),
    gem_cd number(3)
    begin
    dbms_xmlschema.registerSchema('http://www.oracle.com/straat.xsd', dbms_xmlschema.generateschema('SCOTT','STRAAT_T'),TRUE,FALSE);
    end;
    /

  • SAP generating invalid XML for ORDERS05 IDOC

    We have XI 3.0 SP 20 installed here.
    I just started working with XI/PI, so bear with me if this has been asked - I already searched SAP for a note on this and couldn't find one.
    We have integrated sales orders into another system - we have SAP generating an IDOC to be sent when a sales order is created.  We use XI to route it to a 3rd party provider.
    The problem that is occuring is that if an item on the order has an ampersand in the description, the system receiving it tells us that the XML is in error.  In examining the message, it is in error as it doesn't properly escape the ampersand.
    Is there a workaround or patch for this?
    Also - it's not XI that is complaining about the issue, it's our 3rd party provider that is.
    Edited by: Bruce Hartley on Dec 22, 2010 9:34 AM

    Stefan and Abhishek;
    I read the blog - and unless SAP support does not have a fix for issue, I'm not going to use the suggestion in the blog for the exact reasons pointed out by Stefan in the most recent comment.  I have opened a case for this with SAP support and when I get a resolution on it that is not covered by the blog post I will post it here.
    To me, this should work out of the box by SAP and I shouldn't have to write code to work around it.  We're not doing anything fancy or special, we just want to send the order to the 3rd party system via an IDOC interface.  If I was generating the XML by myself, then I would have to convert the stuff.
    I don't think we have < or > in our item descriptions, but I'm sure we have quote characters in there as well.
    We have other systems we use XML with and we did have this issue a long time ago and since I was the one doing the programming and had total control over the process, I was the one who had to fix it - so at least I was aware of it.

  • Recursivity in Oracle Java Class Generator from XML

    I am about to start using Oracle XDK for marshalling/unmarshaling XML documents but
    I need to know if the generator will be able to create correctly the java classes
    from a DTD that is recursive :
    <!-- #[START] -->
    <!ELEMENT node ( date, symbol, node* ) >
    <!ATTLIST node
    name ID #REQUIRED
    ref IDREF #IMPLIED >
    <!ELEMENT date (#PCDATA) >
    <!ELEMENT symbol (#PCDATA) >
    <!-- #[END] -->
    and also, if given a recursive XML (e.g. one compliant with the DTD presented above)
    it will be able to parse correctly the XML into the java classes.
    cheers
    francesc

    well, after having had to try out myself this specific functionality of the
    product, I'm happy to say that YES it works and unlike JAXB
    (maybe I didn't try hard enough with SUN JAXB) it allows recursivity of complex types.
    However, I'm not so happy with the lack of replies in this unattended (or so it seems!) forum
    cheers

  • Generate XML Schema from Java classes?

    Hi,
    Considering an XML Mapping, i would like to generate a default XML Schema from my Java class.
    Is there a tool in toplink (10.1.3) to do that or does anyone have an easy way to generate this XML schema?
    Thanks,
    Ludovic

    Hi Ludovic,
    We don't have support for schema generation from Java classes in TopLink 10.1.3. It's required for JAXB 2.0 so it will be available in a future release.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                           

  • Generation of java classes from XML Schema.

    Hi All,
    I am working with JWSDP-2.0 but got stucked.:
    To generate Java classes from an XML Schema with the JAXB ,I need to have following jar file in thils location with this JWSDP-2.0
    <JWSDP>/jaxb/lib/jaxb-api.jar
    <JWSDP>/jaxb/lib/jaxb-impl.jar
    <JWSDP>/jaxb/lib/jaxb-libs.jar
    <JWSDP>/jaxb/lib/jaxb-xjc.jar
    <JWSDP>/jwsdp-shared/lib/namespace.jar
    <JWSDP>/jwsdp-shared/lib/jax-qname.jar
    <JWSDP>/jwsdp-shared/lib/relaxngDatatype.jar
    And here I m not finding as jaxb-libs.jar,namespace.jar and jax-qname.jar on respective location.
    If I m putting these left jar file from another place it is not generating all the classes as at least in number it should be 45 but it is generating merely 5 classes.
    Can any one help me regarding this.
    Regards.
    Shelly.

    These JAXB JAR files are for JAXB 1.0.
    For JAXB 2.0 the following JAR files are required.
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-api.jar
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-impl.jar
    C:\Sun\jwsdp-2.0\jaxb\lib\jaxb-xjc.jar
    C:\Sun\jwsdp-2.0\jwsdp-shared\lib\activation.jar
    C:\Sun\jwsdp-2.0\sjsxp\lib\jsr173_api.jar
    C:\Sun\jwsdp-2.0\sjsxp\lib\sjsxp.jar

  • Generating xml schema?

    Hi,
    What are the procedures I must take to generate an XML schema? I would like to do this from PL/SQL directly, and just see a printout of the xml document direcly within SQLPLUS.
    Are there any xml schema-specific commands that come with Oracle 9, just to generate xml schemas?
    Please let me know,
    Thanks!

    Yes,
    Please have a look at XSU. Using the classes provided there, you can generate a schema according to the table.
    Hope this helps.

  • Can you generate XML schema from XMLDB?

    I have not used XMLDB and don´t read the entire doc about the product(sorry for that).
    I got the following question, is it possible to generate a XML schema from relational data through XMLDB? Or is this best done via a third party software like XMLSpy or alike?

    3rd Party Software...
    We can generate a schema for an object Hierarchy but our considered opinion is that there is no sensible way to generate an XML Schema representation of a purely relational data structure. It requires a tool which allows you to make decisions on how to organize the heirarchy.

  • Mapping DTO to XML Schema for Worship Web Service

    I have a number of DTOs that my application uses. This application
    needs to consume a number of document style web services created in
    workshop. When I generate the proxies for this web service, it creates
    Java beans for the XML schema types defined in the web service.
    Is there a way to get the workshop stubs to map my DTOs to XML schema?
    If not, what is the best way to do this mapping? Thanks.
    Mike

    I have a number of DTOs that my application uses. This application
    needs to consume a number of document style web services created in
    workshop. When I generate the proxies for this web service, it creates
    Java beans for the XML schema types defined in the web service.
    Is there a way to get the workshop stubs to map my DTOs to XML schema?
    If not, what is the best way to do this mapping? Thanks.
    Mike

  • Mapping DTO to XML Schema for Workshop Web Service

    I have a number of DTOs that my application uses. This application
    needs to consume a number of document style web services created in
    workshop. When I generate the proxies for this web service, it creates
    Java beans for the XML schema types defined in the web service.
    Is there a way to get the workshop stubs to map my DTOs to XML schema?
    If not, what is the best way to do this mapping? Thanks.
    Mike

    I have a number of DTOs that my application uses. This application
    needs to consume a number of document style web services created in
    workshop. When I generate the proxies for this web service, it creates
    Java beans for the XML schema types defined in the web service.
    Is there a way to get the workshop stubs to map my DTOs to XML schema?
    If not, what is the best way to do this mapping? Thanks.
    Mike

  • XML Schema validation Error

    Hi,
    Have a scenerio in which consecutive mapping needs to be done.The first mapping is a Java Mapping in which XML schema validation needs to be done.
    If XML Schema validation is sucessful(Mapping 1),then graphical message mapping(MM_Entry) needs to be performed.
    I have uploded a jar file in imported Archives which contains
    1)Schema file(inputSchema.xsd): This is an XSD file which is generated in XI....XSD fomat of Source message type
    2) The java Class file
    Following are few lines of code for better idea:
    public class SAXParser implements StreamTransformation {
    public void execute(InputStream input, OutputStream output) throws StreamTransformationException {
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
    InputStream mySchema = this.getClass().getClassLoader().getResourceAsStream("inputSchema.xsd");
    SAXParser saxParser = saxParserFactory.newSAXParser();
    saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",mySchema);
    saxParser.parse(input, new HandlerBase());
    After above step(parsing),input is copied to output and streams are closed as follows:
    byte[] buf = new byte[4096];
    for(int len=-1;(len=input.read(buf))!=-1;)
    output.write(buf,0,len);
    input.close();
    output.close();
    After sending correct source message from input ,i am getting following error:
    Runtime exception occurred during execution of application mapping program com/sap/xi/tf/_MM_Entry_: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Parsing an empty source. Root element expected!

    Daniel,
    As I've said, I've used it successfully in PI 7.0 SP10.
    You're right about documentation, it says that by default, Java 1.4.2 mark() and reset() methods of InputStream class are not fully implemented (mark() would do nothing and reset() would always throw an IOException). And that would be the expected behavior...
    ...unless the SAP developers have extended the InputStream class to include actual implementatios to the mark() and reset() methods.
    I'm not saying that they have, but it would be possible, wouldn't it?
    It does work, after all...
    Regards,
    Henrique.

Maybe you are looking for

  • Adobe Bridge CS5 Not Responding

    Periodically I will click from one folder to another folder in Bridge CS5 and it causes Bridge to freeze and give me a "Not Responding" message. I have never had a problem when running a batch or image processor through Bridge, just when clicking fro

  • Adobe Media Encoder Fails to start

    I recently upgraded to CS5, fully 64-bit, but because a lot of my plugins and etc are still 32-bit, I installed the 32-bit support so I could have premiere & after effects CS4 and CS5 on the same system. But this seems to have created a but with medi

  • Why does single numeral appear in the print dialog rather than a preview of my document?

    I'm using a MacBook (late 2008), am running Lion 10.7.3, and changed hard drives recently.  When using Office for Mac 2011 before changing hard drives, I would get this print dialog. After the switch, I get the following dialog.  

  • XHTML Validation and Accessibility

    We've recently completed developing some Application Express systems for a customer, and they were disappointed the pages did not pass W3C XHTML validation to meet their accessibility targets. I've had the chance to do a bit of a post-mortem and nail

  • Finding Item and brand distribution base on customer master

    Please help me to write query on my SQL 2008 database to how in one row the following data 1- Brand, item, Route(Salesman),Division (City), Total Available customer (Per Route),Total Available customer (Per Division), Total Customer purchased the Ite