XML Parsing with schema

Hey all,
I am pretty new to the XML stuff - I need to write a schema for use in JAXB, then validate an XML doc against it. I wrote the doc based on a dbase table, and wrote the schema. What I can't figure out is what to do to have the doc work when trying to validate.
I am getting and error that says I am trying to use xsd but am not bound.
Here is what I have at the start of the docs:
XSD:
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://my-uri"
        elementFormDefault="qualified">
        <element name="Customer" type="CustomerType"/>
     <complexType name="CustomerType">
          <all>.........XML:
<?xml version="1.0" encoding="UTF-8"?>
<Customer xmlns="http://my-uri"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://my-uri file://c:/source/Customer.xsd">

Thanks for replying - I was just trying to validate it using a site I found for now - eventually I will be using JAXB to create a document from the schema. (That is another story) What should I be doing to get the XML document to try and validate against the schema. I have, using different combinations in the namespace, etc gotten the xml doc to validate, but incorrectly - it didn't use the data validations from the schema, which I am pretty sure are correct. Any help you can provide is much appreciated.
Thanks!
KG

Similar Messages

  • Oracle XML parser and schema validation

    Hi Forum,
    I have problem parsing XML with validation against XML schema. I define location of schema (URL) in xml file and Oracle parser could not find the schema (xml file is correct - checked in other programs). When I point to xml schema directly from Java (using parser.setXMLSchema) before calling parser.parse, it works just fine. Where is the problem? Does oracle parser works correctly with XML Schema?
    TIA,
    Alex

    SAXParser saxParser=new SAXParser();
    saxParser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    Specify a Schema to validate a XML document with, for the SAXParser.
    saxParser.setXMLSchema(SchemaUrl);
    DefaultHandler handler=new DefaultHandler();
    saxParser.setErrorHandler(handler);
    Parse the XML document to validate with the XML schema.
    saxParser.parse(XmlDocumentUrl);

  • XML parser with document support

    Hi all,
    For a whole week now, I m still looking for a nice (but lite) XML parser for J2ME applications. Of course I found kXML 2 parser but I'm confused.
    kXML 2 implements the XmlPull API (xmlpull.org) so you can parse easly an XML file with functions as next(), ...
    BUT, I would like to deal with a Document Object Model (DOM) (like JDom for J2SE), with this I will be able to do some nice stuff like doc.getRoot().getElement....
    In kXML2 Javadoc I found something like this but apparently it doesnt work well (or I dont know how to use it).
    Do someone know this API ? http://kxml.sourceforge.net/kxml2/javadoc/
    I can't find any example on Internet, everybody seems to use it without DOM....
    Until someone give me an answer I will continue to use kXML2 without document object model :(
    thanks guys,

    just a search..in http://sourceforge.net/
    http://sourceforge.net/search/?type_of_search=soft&type_of_search=soft&words=dom+j2me

  • Xml validation with schema, unbounded and any order of elements

    Hi
    I want to validate a xml file the user creates. I am currently using schema to do this. However there needs to be the possibility of a totally random mix of three different types of elements in a parent element. I couldn't find out how to do this, maybe it is not possible with schema? I thought I could look at the error message generated and ignore it if it was caused by one of the three elements mentioned above, but while the error message generated says which element is expected, it does not say which element caused the error.
    Thanks in advance for any help.

    Ruskin wrote:
    However there needs to be the possibility of a totally random mix of three different types of elements in a parent element. Can you take your example to make it more clear? Does all three elements mutually exclusive?

  • Error in XML Parsing  through Schema doc.MalformedURLException

    Hi,
    I need to validate xml file before parsing it through XML schema validation. My XML file and schema files are in the same directory and I need am validation it using below code.
    Java Code_
    String rbBasePath = ConfigurationFactory.getInstance().getConfigurations("ConfigParam").get("config.rb.properties", DEFAULT_RB_PATH);
    InputSource xmlInputSource = new InputSource (rbBasePath + ConfigConstants.XML_FILE_NAME);
    File schemaFileObj = new File (rbBasePath + ConfigConstants.XML_SCHEMA_FILE_NAME);
    SAXSource source = new SAXSource (xmlInputSource);
    SchemaFactory sf = SchemaFactory.newInstance (XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = sf.newSchema (schemaFileObj);
    Validator validator = schema.newValidator ();
    validator.setErrorHandler (new ParserErrorHandler());
    validator.validate (source);
    But, I am getting following error.
    java.net.MalformedURLException: unknown protocol: c_
    After some google, I found there may be some bug which does not read the file if file path contains some space in between. But in my case schema path does not contain any space in between.
    Please help to figure out this issue.
    Edited by: Jaykishan on Jul 20, 2011 12:17 PM
    Edited by: Jaykishan on Jul 20, 2011 12:18 PM

    Error occurs at below line of code.
    validator.validate (source);
    Error message: MalformedURLException. java.net.MalformedURLException: unknown protocol: c
    My xml and xsd file is located at: C:\config\resources\AlertData.xml, C:\config\resources\AlertDataSchema.xsd.

  • XML Parsing with XSL Performance lag

    Hi there
    I should qualify this post by saying I am fairly new to EJB's and have based the below on a Java Working with XML Tutorial I read.
    I have an EJB which is being developed to parse XML documents with an XSL stylesheet and return HTML for display. The code is working fine however there is a fairly hefty performance lag when using the EJB to generate the HTML as opposed to the straight HTML. I am getting an average response time of 95000ms using the EJB as opposed to 45000ms when viewing the straight HTML. The code I am using to do the parsing is :
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(dataFile);
    // Convert docs into StreamSource
    StreamSource stylesource = new StreamSource(styleSheet);
    StreamSource source = new StreamSource(dataFile);
    StringWriter strWrite = new StringWriter();
    StreamResult result = new StreamResult(strWrite);
    // Use a Transformer for output
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(stylesource);
    transformer.transform(source, result);
    There is then some error handling and the strWrite object is placed into an array to be returned.
    I am really looking to find out if the performance lag I am experiencing is normal or if there is anything I can do to improve the speed of the code.
    All comments and help is most appreciated.
    Cheers
    Justin.

    You should be able to increase performance by caching Templates objects in memory as a previous post suggested.
    Here is some untested code:public final class TransformerCache
         private static Map cache = new Vector();
         private TransformerCache(){}
         public static Transformer getTransformer( String filename )
              if( ! cache.containsKey( filename ) )
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Templates template = tf.newTemplates( new StreamSource( filename ) );
                   cache.put( filename, template );     
              return ( ( Templates ) cache.get( filename ) ).newTransformer();
    }This aproach works in a clustered environment, just bear in ming that there will be an instance of the cache on each server instance (virtual machine).

  • Using a xml parser with jbuilder

    I'm using jbuilder and the required librairies I've just added require me to add an XML parser to the path. I've just downloaded one from www.apache.org.
    How do I incorporate this parser into my project. I need to use the following packages but I'm not sure how I can put everything together.
    If you understand what my problem is please help. Thanks , B.
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMException;

    Go to tools | configure libraries.
    click the new button on the left
    Type in the name you want the library to be identified with (XML Parser or something)
    Choose the location (this determines how many people and projects have access to the libraries)
    Click the add button and find the *.jar files.
    Ok back out of the dialogs
    Now select the Project Properties (or default props to have the library available to all projects, not recommended tho)
    Select the paths tab
    Click Add and select the Library you added in the earlier steps.
    If you have any probs, www.borland.com has heaps of stuff on configuring libraries

  • XML parsing with SQL/PL-SQL

    Hi,
    My question is about how can an XML message can be best parsed using SQL/PL-SQL.
    The scenario is as follow. The XML message is stored in a CLOB; only some of its data needs to be extracted; there are six different types of structures of XML; the size of each XML is about 50 lines (maximum depth level is 3); the data could be written in English or Greek or French or German or Russian; this is going to be done every hour and the parsing is going to be against 3,000 records approx.
    In the development, I need to take into consideration performance. We are using Oracle 10, but we could migrate to Oracle 11 if necessary.
    Apologies for this basic question but I have never done XML parsing in SQL/PL-SQL before.
    Thank you.
    PS I have copied this question to the XML forum.
    Edited by: user3112983 on May 19, 2010 3:30 PM
    Edited by: user3112983 on May 19, 2010 3:39 PM

    user3112983 wrote:
    The scenario is as follow. The XML message is stored in a CLOB; only some of its data needs to be extracted; there are six different types of structures of XML; the size of each XML is about 50 lines (maximum depth level is 3); the data could be written in English or Greek or French or German or Russian; this is going to be done every hour and the parsing is going to be against 3,000 records approx.Parsing is done using the XMLTYPE data type (object class) in Oracle.
    Something as follows:
    SQL> create table xml_doc( id number, doc clob );
    Table created.
    SQL>
    SQL> insert into xml_doc values( 1, '<root><row><name>John</name></row><row><name>Jack</name></row></root>' );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> declare
      2          rawXml  xml_doc.doc%type;
      3          xml     xmltype;
      4  begin
      5          -- get the raw XML (as a CLOB)
      6          select doc into rawXml from xml_doc where id = 1;
      7
      8          -- parse it
      9          xml := new xmltype( rawXml );  
    10         -- process the XML...
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SQL>The variable xml in the sample code is the XML DOM object. XML functions can be used against it (e.g. to extract values in a tabular row and column structure).
    Note that the CLOB needs to contain a valid XML. An XML containing XML fragments is not valid and cannot be parsed. E.g.
    SQL> declare
      2          xml     xmltype;
      3  begin
      4          -- attemp to parse fragments
      5          xml := new xmltype( '<row><name>John</name></row>  <data><column>Name</column></data>' );
      6  end;
      7  /
    declare
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00245: extra data after end of document
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 301
    ORA-06512: at line 5This XML contains 2 fragments. A row structure and a data structure. It is not a valid XML and as such cannot be parsed. If a root tag is used to encapsulate these 2 fragments, then it will be a valid XML structure.
    In the development, I need to take into consideration performance. We are using Oracle 10, but we could migrate to Oracle 11 if necessary.Have not run into any XML performance problems specifically - and am using it extensively. Even large XMLs (10's of 1000's of elements) parse pretty fast.

  • Applet parsing XML doc with schema

    I'm trying to parse (org.apache.xerces.parsers.SAXParser) an xml document and validate it with a schema file. I'm having a little difficulty understanding how the schemaLocation (as specified in the xml file) is used by the parser. I'm trying to use a relative path....but what is it relative to???
    In the xml file I specify the schemaLocation as...
    xsi:schemaLocation="http://tempuri.org/DeviceDefinition.xsd ./Configuration/DeviceDefinition.xsd"
    The directory structure I'm using is...
    ProjectX/applet.jar
    ProjectX/applet.html
    ProjectX/Configuration/DeviceDefinition.xml
    ProjextX/Configuration/DeviceDefinition.xsd
    It's my understanding that when working with an applet the paths are a relative to the directory where the applet is installed - ProjectX in this case. Yet when I use the above defined schemaLocation I get the following error:
    [Fatal Error] :0:0: File "file:///C:/Documents and Settings/dnelson/Desktop/Configuration/DeviceDefinition.xsd" not found.
    It seem to be using my user.dir as a starting point for the relative path. Does anyone know why this happens???
    What's the proper way to specify the schemaLocation??

    xerces hates spaces in uri. so try encoding the url or get rid of the spaces

  • Parsing with schema

    Applying this code            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                factory.setValidating(true);
                factory.setIgnoringElementContentWhitespace(true);
                factory.setAttribute(
                        "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
                        "http://www.w3.org/2001/XMLSchema");
                //factory.setFeature("http://xml.org/sax/features/validation", true);
                DocumentBuilder builder = factory.newDocumentBuilder();
                relDoc = builder.parse(relFileName);on this xml file (excerpt)
    <?xml version="1.0" encoding="UTF-8"?>
    <album_artist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="musicbox_neu.xsd">
    <album-artist><album>333544981</album><artist>2569160</artist>with the schema here
    <?xml version="1.0"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="album_artist"><xs:complexType><xs:sequence maxOccurs="unbounded">
    <xs:element name="album-artist">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="albumid" type="ID"/>
    <xs:element name="artistid" type="ID"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element></xs:sequence>
    </xs:complexType>
    </xs:element>I get this error message
    Error: URI = "file:///C:/Dev/Lab/MusicBox/Resources/album-artist.xml", Line = "2
    ", : cvc-elt.1: Cannot find the declaration of element 'album_artist'. Any help appreciated!!!

    Thanks for replying - I was just trying to validate it using a site I found for now - eventually I will be using JAXB to create a document from the schema. (That is another story) What should I be doing to get the XML document to try and validate against the schema. I have, using different combinations in the namespace, etc gotten the xml doc to validate, but incorrectly - it didn't use the data validations from the schema, which I am pretty sure are correct. Any help you can provide is much appreciated.
    Thanks!
    KG

  • Java XML parsing with Xerces in Eclipse using Oxygen problem

    Hey everybody,
    Got me a stickler of a prob here and i'm hoping sum one out there will be able to help. I am trying to parse XML files into JDom objects so i can use them in the rest of my project with ease, but i'm having trouble parsing anything wihtout getting these errors
    Error: URI = /filelocat/personal-schema.xml", Line = "3", : Document root element "personnel", must match DOCTYPE root "null".
    Error: URI = /filelocat/personal-schema.xml", Line = "3", : Document is invalid: no grammar found.
    Error: URI = /filelocat/personal-schema.xml", Line = "3", : cvc-complex-type.3.2.2: Attribute 'xsi:noNamespaceSchemaLocation' is not allowed to appear in element 'personnel'.
    Error: URI = /filelocat/personal-schema.xml", Line = "3", : cvc-complex-type.3.2.2: Attribute 'xsi:noNamespaceSchemaLocation' is not allowed to appear in element 'personnel'.
    The are the files are ones that come in Oxygens samples folder so they should be correct. The code is as follows
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              factory.setValidating(true);
    SchemaFactory sFact = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
    Schema schema = sFact.newSchema(schemaFile);
    factory.setSchema(schema);
    DocumentBuilder dommer = factory.newDocumentBuilder();          
    Document doco = dommer.parse(xmlFile.getAbsolutePath());None of these errors appears to be fatal, i can still use the doco object and extract the information i require, but i want to understand where the errors are coming from. There must be a parser setting or sumthing i've missed somewhere.
    Can anyone help?
    Any ideas/surgestions/critique welcome.
    Tom

    When we are parsing this xml: "<CustomerInfo><VCID/>77888</CustomerInfo>".
    See comments in following code.
    Element docEle = d.getDocumentElement(); // Returns "CustomerInfo" element node.
    NodeList childNodes2 = docEle.getChildNodes(); // Returns two nodes: <VCID/> element node and 77888 text node.
    Node item4 = childNodes2.item( 0 ); // First node (element node) of the "CustomerInfo" tag. <VCID/>
    Node item5 = childNodes2.item( 1 ); // Second node (text node) of the "CustomerInfo" tag is 77888. Look this text is not child of VCID, it's second child node of "CustomerInfo" tag.
    NodeList childNodes3 = item4.getChildNodes(); // Returns null because <VCID/> node is empty.
    String nodeValue = item5.getNodeValue(); // Returns 77888 ( text node ).               Regards,
    S&#322;awomir Wojtasiak

  • Error in XML Parsing  through Schema doc.

    I know this is not the correct group for XML related queries. I had posted the query in XML forum but could not get any reply. I have been in the forum and know this is very active forum.
    Please help if you can..
    Hi Friends,
    I am trying to validate XML file as per the defined schema document through JAXB parser.
    Following is my xml. schema and java class code.
    XML File*
    <?xml version="1.0"?>
    <notify xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="NotificationDetailsSchema.xsd">
    <notification>
    <alertname>Alert1</alertname>
    <deletable>Y</deletable>
    <descurl>Alert1URL</descurl>
    </notification>
    <notification>
    <alertname>Alert2</alertname>
    <deletable>Y</deletable>
    <descurl>Alert2URL</descurl>
    </notification>
    </notify>
    Schema file_
    <?xml version="1.0" encoding="windows-1252"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xsd:element name="notify">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="notification" maxOccurs="unbounded">
    <xsd:complexType mixed="true">
    <xsd:sequence>
    <xsd:element name="alertname">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:minLength value="1"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="deletable">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:pattern value="Y|N"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="descurl">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:minLength value="1"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    Java Class_
    SAXSource source = new SAXSource (xmlInputSource);
    SchemaFactory sf = SchemaFactory.newInstance (XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = sf.newSchema(schemaFileObj);
    Validator validator = schema.newValidator ();
    validator.setErrorHandler (new ParserErrorHandler());
    validator.validate (source);
    I tried to execute the validation through stand along java class and it worked correctly.
    However when I added this class into my Fusion web application, I am getting following error.
    org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'Alert1'._
    Can you please help me to figure out this problem?
    Edited by: Jaykishan on Jul 20, 2011 10:04 AM

    earlier it was
    org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'USAVER'.anmd now it is
    org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'Alert1'.some problem in this Alert1 message is what i guess.. some parsing error.. look closely..
    i guess some of the xml characters are not rendered properly in forum software.. or it may be truncated.. so i believe something wrong which is not visible..

  • XML Parsing with Tags increasing in no's

    I have an XML that I am recieving it from other system like below :
    <ResultSet>
      <ERROR_CODE_ID>0</ERROR_CODE_ID>
      <ERROR_DESCRIPTION>Success</ERROR_DESCRIPTION>
    <Rows>
    <Row1>
      <RATE_EFFECTIVE_DT>2013-08-24
    00:00:00.0</RATE_EFFECTIVE_DT>
    <INDEX_NAME>LN-EBOR-7D-AED              
    </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>7D</TERM>
      <TERM_NO>7</TERM_NO>
      <TERM_PERIOD>D</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.15430000</RATE>
    </Row1>
    <Row2>
      <RATE_EFFECTIVE_DT>2013-08-26
    00:00:00.0</RATE_EFFECTIVE_DT>
      <INDEX_NAME>LN-EBOR- 1M-AED  
               </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>1M</TERM>
      <TERM_NO>1</TERM_NO>
      <TERM_PERIOD>M</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.52430000</RATE>
    </Row2>
    <Row3>
      <RATE_EFFECTIVE_DT>2013-08-25
    00:00:00.0</RATE_EFFECTIVE_DT>
    <INDEX_NAME>LN-EBOR-2M-AED              
    </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>2M</TERM>
      <TERM_NO>2</TERM_NO>
      <TERM_PERIOD>M</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.66710000</RATE>
    </Row3>
    <Row4>
      <RATE_EFFECTIVE_DT>2013-08-24
    00:00:00.0</RATE_EFFECTIVE_DT>
      <INDEX_NAME>LN-EBOR-
    3M-AED             
    </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>3M</TERM>
      <TERM_NO>3</TERM_NO>
      <TERM_PERIOD>M</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.86140000</RATE>
    </Row4>
    <Row5>
      <RATE_EFFECTIVE_DT>2011-05-23
    00:00:00.0</RATE_EFFECTIVE_DT>
      <INDEX_NAME>LN-EBOR-
    4M-AED             
    </INDEX_NAME>
      <TYPE>LN</TYPE>
      <RATE_TYPE>EBOR</RATE_TYPE>
      <TERM>4M</TERM>
      <TERM_NO>4</TERM_NO>
      <TERM_PERIOD>M</TERM_PERIOD>
      <CCY>AED</CCY>
      <RATE>0.0</RATE>
    </Row5>
    </Rows>
    </ResultSet>
    The data is comming in multiple row tag with Row1,Row2,Row3...so on.
    I am not able to parse the XML with Row1,Row2..etc. I need some help.

    Do you want to do this using Oracle database (which version?), or some other tools ?

  • Erro in XML validation with schema document.

    Hi Friends,
    I am trying to validate XML file as per the defined schema document through JAXB parser.
    Following is my xml. schema and java class code.
    XML File_
    <?xml version="1.0"?>
    <notify xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="NotificationDetailsSchema.xsd">
    <notification>
    <alertname>Alert1</alertname>
    <deletable>Y</deletable>
    <descurl>Alert1URL</descurl>
    </notification>
    <notification>
    <alertname>Alert2</alertname>
    <deletable>Y</deletable>
    <descurl>Alert2URL</descurl>
    </notification>
    </notify>
    Schema file_
    <?xml version="1.0" encoding="windows-1252"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xsd:element name="notify">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="notification" maxOccurs="unbounded">
    <xsd:complexType mixed="true">
    <xsd:sequence>
    <xsd:element name="alertname">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:minLength value="1"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="deletable">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:pattern value="Y|N"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="descurl">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:minLength value="1"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    Java Class_
    SAXSource source = new SAXSource (xmlInputSource);
    SchemaFactory sf = SchemaFactory.newInstance (XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = sf.newSchema(schemaFileObj);
    Validator validator = schema.newValidator ();
    validator.setErrorHandler (new ParserErrorHandler());
    validator.validate (source);
    I tried to execute the validation through stand along java class and it worked correctly.
    However when I added this class into my Fusion web application, I am getting following error.
    org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'USAVER'.*
    Can you please help me to figure out this problem?

    Ruskin wrote:
    However there needs to be the possibility of a totally random mix of three different types of elements in a parent element. Can you take your example to make it more clear? Does all three elements mutually exclusive?

  • Web service XML use with Schema

    Hi!
    I have a Webservice working ok and a can see the xml, but, the after process for read this data(I do it trought pbl) take too time, then i go to try use of schema, as follow structure:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <xsd:simpleType name="nombres" type="xsd:string"/>
         <xsd:simpleType name="paterno" type="xsd:string"/>
         <xsd:simpleType name="materno" type="xsd:string"/>
         <xsd:simpleType name="email" type="xsd:string"/>
         <xsd:simpleType name="codigo" type="xsd:string"/>
         <xsd:simpleType name="vigencia" type="xsd:string"/>
         <xsd:simpleType name="fecIni" type="xsd:string"/>
         <xsd:simpleType name="fecTer" type="xsd:string"/>
         <xsd:simpleType name="codCargo" type="xsd:string"/>
         <xsd:simpleType name="codGrado" type="xsd:string"/>
         <xsd:simpleType name="codPuesto" type="xsd:string"/>
         <xsd:simpleType name="codRepart" type="xsd:string"/>
         <xsd:simpleType name="codOrganismo" type="xsd:string"/>
         <xsd:simpleType name="descCargo" type="xsd:string"/>
         <xsd:simpleType name="descEscalafon" type="xsd:string"/>
         <xsd:simpleType name="descReparticion" type="xsd:string"/>
         <xsd:simpleType name="descEstamento" type="xsd:string"/>
         <xsd:simpleType name="descJerarquia" type="xsd:string"/>
         <xsd:group name="nombramientos">
              <xsd:sequence>
                   <xsd:element name="codigo" type="codigo"/>
                   <xsd:element name="vigencia" type="vigencia"/>
                   <xsd:element name="fecIni" type="fecIni"/>
                   <xsd:element name="fecTer" type="fecTer"/>
                   <xsd:element name="codCargo" type="codCargo"/>
                   <xsd:element name="codGrado" type="codGrado"/>
                   <xsd:element name="codPuesto" type="codPuesto"/>
                   <xsd:element name="codRepart" type="codRepart"/>
                   <xsd:element name="codOrganismo" type="codOrganismo"/>
                   <xsd:element name="descCargo" type="descCargo"/>
                   <xsd:element name="descEscalafon" type="descEscalafon"/>
                   <xsd:element name="descReparticion" type="descReparticion"/>
                   <xsd:element name="descEstamento" type="descEstamento"/>
                   <xsd:element name="descJerarquia" type="descJerarquia"/>
              </xsd:sequence>
         </xsd:group>
         <xsd:complexType name="Usuario">
              <xsd:sequence>
                   <xsd:choice>
                        <xsd:element name="nombres" type="nombres"/>
                        <xsd:element name="paterno" type="paterno"/>
                        <xsd:element name="materno" type="materno"/>
                        <xsd:element name="email" type="email"/>
                        <xsd:group ref="nombramientos"/>
                   </xsd:choice>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:element name="usuario" type="Usuario"/>
    </xsd:schema>
    ... and the xml i using as the next:
    <usuario>
         <nombres>Oscar Hernan</nombres>
         <paterno>Pozo</paterno>
         <materno>Ortiz</materno>
         <email>[email protected]</email>
         <nombramientos class="list">
              <nombramiento>
                   <codigo>A110401412002</codigo>
                   <vigencia>1</vigencia>
                   <fecIni>2002-01-01 00:00:00.0</fecIni>
                   <fecTer>2002-12-31 00:00:00.0</fecTer>
                   <codCargo>N3A075</codCargo>
                   <codGrado>13</codGrado>
                   <codPuesto>A22004</codPuesto>
                   <codRepart>11040501</codRepart>
                   <codOrganismo>11040000</codOrganismo>
                   <descCargo>ANALISTA COMPUTACIONAL</descCargo>
                   <descEscalafon>N3A</descEscalafon>
                   <descReparticion>Dirección de Servicios de Tecnologías de Información</descReparticion>
                   <descEstamento>A</descEstamento>
                   <descJerarquia>Técnica</descJerarquia>
              </nombramiento>
              <nombramiento>
                   <codigo>A120200011978</codigo>
                   <vigencia>1</vigencia>
                   <fecIni>1978-09-15 00:00:00.0</fecIni>
                   <fecTer>2099-12-31 00:00:00.0</fecTer>
                   <codCargo>A2A001</codCargo>
                   <codGrado>05</codGrado>
                   <codPuesto>001767</codPuesto>
                   <codRepart>19012061</codRepart>
                   <codOrganismo>12060000</codOrganismo>
                   <descCargo>Académico Prof. Asociado</descCargo>
                   <descEscalafon>A2A</descEscalafon>
                   <descReparticion>Aporte Institucional Ciencias Físicas </descReparticion>
                   <descEstamento>A</descEstamento>
                   <descJerarquia>Prof. Asociado - Categ. Academica Ord.</descJerarquia>
              </nombramiento>
         </nombramientos>
    </usuario>
    As you see, i'm try retrieve data "nombramientos" in a group, but que schema is not charging in albpm with this structure.
    A need let "nombramientos" tag in a group to use it as correct.
    Please.. if any body can help me.
    Nathan Bernal

    I'm new to web services, but we are currently
    implementing a number of Web Services that all take
    as arguments a single parameter which is an XMLBean,
    which has been generated by a XML Schema.
    What I find surprising is that when I submit a SOAP
    message to the Web Service (through the http Web
    Service Tester inside eclipse), I can send any valid
    XML without getting a SOAP fault. Is there a way on
    the Web Service that I want the XML submitted to be
    validated against the XML Schema for that parameter?
    Bit surprised I have to implement my own input
    argument validation, and there doesn't appear to be a
    standard way to do this. I must be missing soemthing
    surely? Why else would the Schema be in the WSDL?
    Cheers
    JohnHas anyone found an answer to this, we have the same issue?

Maybe you are looking for

  • Issue editing CS3 files in CS5, hangs ID forever, 100% processor

    When opening or modifying CS3 files in CS5, ID will hang forever. Specifically, we have documents that have complex advertiser approval objects on the slug area, many are grouped and have script labels. We have multiple objects on the pasteboard,  ab

  • Which program is the problem?

    Trying to encode HD content that I'm watching on Windows Media Center. Every time I do this, the computer locks up and freezes completely, crashing the computer. It's odd. If I encode HD content but at 640x360, it works. If I encode SD content but in

  • Does iTunes have any hidden picture controls for video playback (e.g. contrast, brightness) ?

    Does iTunes have any hidden picture controls for video playback (e.g. contrast, brightness) ? I haven't been able to find any. Since the .m4v file type appears to prevent any video bought or rented from the iTunes Store from being played using any ot

  • Substitution of BELNR

    Hello to all.  We have a requirement that will entail us to substitute the value of BKPF-BELNR (SAP Document number) into the Reference (BKPF-XBLNR) and Reference Key 1 fields (BSEG-XREF1).  At the time of the substitution call-ups (separate for the

  • Form mail form handler properties

    I am a newbie to dreamweaver 8. I have created and posted a basic contact form at http://www.patentsmakemoney.com/ContactUs.html. The form does not work. I want visitors to be able to send me some basic information and eventually expand the form and