Validate XML with Schema?

So, according to Adobe...
quote:
Dreamweaver CS3 continues to support not only the creation
and editing of XML and XSL files, but it also allows you to import
DTDs and schemas and to validate XML documents.
Does anyone know how to accomplish this task? Adobe's
documentation on this topic seems be less current than their
marketing material.
I mean, I'm assuming from the way this is worded it means
that you can "import DTDs and schemas and ... validate XML
documents"
with said schemas. Or is this just some shifty marketing
trickery which really means you can import (i.e., open) a DTD or
schema, and, as a completely unrelated task, you can "validate"
your XML file - to the extent that Dreamweaver will tell you if you
forgot to close a tag?

I tried to move all the xml, class and xsd files in the same folder and it still didn't work...
And I can't hard coded the xsd file on the document... so the only way is to set the xsd location inside the java codes... here's what I have:
static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
File xsdFile = new File("schema.xsd");
saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
saxParser.setProperty(JAXP_SCHEMA_SOURCE, xsdFile);
Please help... thx.

Similar Messages

  • Persisting unexplained errors when parsing XML with schema validation

    Hi,
    I am trying to parse an XML file including XML schema validation. When I validate my .xml and .xsd in NetBeans 5.5 beta, I get not error. When I parse my XML in Java, I systematically get the following errors no matter what I try:
    i) Document root element "SQL_STATEMENT_LIST", must match DOCTYPE root "null".
    ii) Document is invalid: no grammar found.
    The code I use is the following:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    My XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Defining the SQL_STATEMENT_LIST element -->
    <xs:element name="SQL_STATEMENT_LIST" type= "SQL_STATEMENT_ITEM"/>
    <xs:complexType name="SQL_STATEMENT_ITEM">
    <xs:sequence>
    <xs:element name="SQL_SCRIPT" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <!-- Defining simple type ApplicationType with 3 possible values -->
    <xs:simpleType name="ApplicationType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="DawningStreams"/>
    <xs:enumeration value="BaseResilience"/>
    <xs:enumeration value="BackBone"/>
    </xs:restriction>
    </xs:simpleType>
    <!-- Defining the SQL_SCRIPT element -->
    <xs:element name="SQL_SCRIPT" type= "SQL_STATEMENT"/>
    <xs:complexType name="SQL_STATEMENT">
    <xs:sequence>
    <xs:element name="NAME" type="xs:string"/>
    <xs:element name="TYPE" type="xs:string"/>
    <xs:element name="APPLICATION" type="ApplicationType"/>
    <xs:element name="SCRIPT" type="xs:string"/>
    <!-- Making sure the following element can occurs any number of times -->
    <xs:element name="FOLLOWS" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and my XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Document : SQLStatements.xml
    Created on : 1 juillet 2006, 15:08
    Author : J�r�me Verstrynge
    Description:
    Purpose of the document follows.
    -->
    <SQL_STATEMENT_LIST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.dawningstreams.com/XML-Schemas/SQLStatements.xsd">
    <SQL_SCRIPT>
    <NAME>CREATE_PEERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE PEERS (
    PEER_ID           VARCHAR(20) NOT NULL,
    PEER_KNOWN_AS      VARCHAR(30) DEFAULT ' ' ,
    PRIMARY KEY ( PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITIES_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITIES (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    COMMUNITY_KNOWN_AS VARCHAR(25) DEFAULT ' ',
    PRIMARY KEY ( COMMUNITY_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITY_MEMBERS (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    PEER_ID VARCHAR(20) NOT NULL,
    PRIMARY KEY ( COMMUNITY_ID, PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_PEER_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE PEERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITIES_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITIES IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITY_MEMBERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_VIEW</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE VIEW COMMUNITY_MEMBERS_VW AS
    SELECT P.PEER_ID, P.PEER_KNOWN_AS, C.COMMUNITY_ID, C.COMMUNITY_KNOWN_AS
    FROM PEERS P, COMMUNITIES C, COMMUNITY_MEMBERS CM
    WHERE P.PEER_ID = CM.PEER_ID
    AND C.COMMUNITY_ID = CM.COMMUNITY_ID
    </SCRIPT>
    <FOLLOWS>CREATE_PEERS_TABLE</FOLLOWS>
    <FOLLOWS>CREATE_COMMUNITIES_TABLE</FOLLOWS>
    </SQL_SCRIPT>
    </SQL_STATEMENT_LIST>
    Any ideas? Thanks !!!
    J�r�me Verstrynge

    Hi,
    I found the solution in the following post:
    Validate xml with DOM - no grammar found
    Sep 17, 2003 10:58 AM
    The solution is to add a line of code when parsing:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    The errors are gone !!!
    J�r�me Verstrynge

  • Undigesting XML with Schema and Rules

    We currently use a Digester with schema and rules files to digest an input XML and automatically build our Java objects. What I'd like to know is if there is a REVERSE process? Is there any class or utility that can take those Java objects and build an XML file?
    Thanks,
    Rich

    Ask Microsoft why IE6 does not validate. Normally server-side developers do
    not rely on a browser to validate XML against schema or DTD but validate XML
    on the server. The same is true for XSLT transformations...
    "Benoit Degreve" <[email protected]> wrote in message
    news:aqnihv$l75$[email protected]..
    Hi everybody,
    I'm trying to validate an XML file with a schema but it doesn't seem to
    work.
    I open the XML file (that doesn't match the rules that are in the schema)
    with a IE6, and there is no errors...
    I have the same problem with a DTD (its reference is in the XML file like
    shown in my book)...
    Does the validation process have to be done by a specific application ?For
    the schema ? For the DTD ? In other words, does IE6 make the validation
    process automatically ?
    Could someone help me ?

  • Validate xml with complextype schema without root element!

    Hi All!
    I have a problem that. I want to validate a xml data of complextype but the schema i want to validate is[b] not have root element.
    For example:
    The schema like that
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="www.thachpn.test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="www.thachpn.test" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:complexType name="Name">
              <xs:sequence>
                   <xs:element name="FirstName" type="xs:string"/>
                   <xs:element name="LastName" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    and the xml data i want to validate like this
    <?xml version="1.0" encoding="UTF-8"?>
    <Name xmlns="www.thachpn.test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <FirstName>Pham</FirstName>
         <LastName>Thach</LastName>
    </Name>
    My Algorithm is like that:
    I create a complextype object by above schema
    then i create new element with given name and namespace
    after that i use schema of this element to validate xml data.
    I use xmlparserv2 lib of oracle
    But i can not find how to create complextype from schema or create element with have complextype.
    Please help me.
    Thanks a lot!

    <?xml version="1.0" encoding="UTF-8"?>
    Modify the schema.
    Add a root element.
    <xs:schema targetNamespace="www.thachpn.test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="www.thachpn.test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xsd:element name="Name" type="Name"/>
    <xs:complexType name="Name">
    <xs:sequence>
    <xs:element name="FirstName" type="xs:string"/>
    <xs:element name="LastName" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>

  • IllegalArgumentException - error validating xml with schema

    I'm trying to validate an XML document using the following:
    JAXP 1.2
    Xerces 1.4.4
    JDK 1.4.1
    The xml is valid and I can confirm it with XML Spy when I point it to the schema definition. But, I get an IllegalArgumentException when I try to do it in my class.
    Here's the code...
    public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    public static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
    public static final String CIS_SCHEMA = "D:\\dev\\xml\\cis.xsd";
    public static final String[] SCHEMAS = { W3C_XML_SCHEMA, CIS_SCHEMA };
    private static DocumentBuilderFactory dbf;
    private static DocumentBuilder db;
    try {
         dbf.setNamespaceAware(true);
         dbf.setValidating(true);
         dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, SCHEMAS);
    } (catch ...) {
    I get the following error:
    java.lang.IllegalArgumentException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    Any ideas?

    When I tried this with Xerces SAX, I got---
    org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
    Maybe Xerces has not implemented the schemaLanguage property.
    I have been successfully using Xerces-dependent properties to do validation:
    XMLReader parser = saxParser.getXMLReader();
    parser.setFeature( "http://xml.org/sax/features/validation", true);
    parser.setFeature( "http://xml.org/sax/features/namespaces", true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema", true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", true);
    if (noNamespaceSchemaLocation!=null) {
    parser.setProperty(
    "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
    noNamespaceSchemaLocation);
    if (schemaLocation!=null) {
    parser.setProperty(
    "http://apache.org/xml/properties/schema/external-schemaLocation",
    schemaLocation);
    Also, as DrClap pointed out, for the schema location I use URIs.
    Please let me know if you got the jaxp schemaLocation property to work and how you did it.

  • Validate XML using schema

    Hi,
    I want to validate a xml from a schema (xsd). Can I uses a parser (any parser - xerces perhaps) and read the xsd into a String and then pass that string object to the parser?
    So instead of this:
    SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser", true);
    builder.setFeature("http://apache.org/xml/features/validation/schema",
                        true);
    builder.setProperty("http://apache.org/xml/properties/schema"
                             + "/external-noNamespaceSchemaLocation",
    LOCATION OF XSD);
    Can I replace "LOCATION OF XSD" with a String argument that represents the contents of the XSD instead of the location to the xsd?
    Thanks

    A Schema validator could be used to validate your xml with a schema.
    TIBCO XMLValidate is a schema validator.
    http://www.tibco.com/solutions/products/extensibility/xml_validate.jsp

  • Can not validate XML against schema

    Hi all,
    I'm new to XML validation. I have this sample from net.
    this is the schema definition:
    <xs:schema targetNamespace="http://www.w3schools.com" elementFormDefault="qualified">
    <xs:element name="note" type="xs:string"/>
    </xs:schema>
    and this is the xml file:
    <?xml version="1.0"?>
    <note xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com note.xsd">
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
    </note>
    when i try to validate at http://schneegans.de/sv/, this is a validator i found searching
    it gives error
    The root element does not comply with the schema. (2:2)
    any ideas?
    i have created my own xml and schema.I registered the xsd on oracle 10g but i get the same error :(
    where can i validate my xml against a schema?
    thanx a lot

    Validating XML Documents Against XML Schema
    http://www.oracle.com/technology/pub/articles/vohra_xmlschema.html

  • Validation of XML with Schema, which contains more than one Schema

    Hi All,
    I am having a parent.xsd file, which inculdes or imports child.xsd file. I need to validate an xml with the parent xsd. Could u give any sample code for doing the same.
    Java Version : 1.4.2
    Using Xerces for parsing the xml....
    Thanks,
    Senthil

    Is anyone there to reply?

  • Validate xml with PL/SQL Parser

    Hi,
    i have an xml DTD into a VARCHAR2 variable and an xml document
    into a CLOB, i'd like to know how to validate the xml with my
    DTD using PL/SQL API for xml.
    Sorry for my terrible english (i'm not english) :-)
    Tank you.

    Here's an example:
    set serveroutput on
    DECLARE
      p xmlparser.parser;
      d xmldom.DOMDocument;
      dtd xmldom.DOMDocumentType;
      v varchar2(32700);
      good clob;
      bad clob;
      xml_parse_error exception;
      pragma exception_init(xml_parse_error,-20100);
    BEGIN
      bad   := '<!DOCTYPE Department SYSTEM "test.dtd"><Deprtment/>';
      good  := '<!DOCTYPE Department
    SYSTEM "test.dtd"><Department/>';
      v := '<!ELEMENT Department EMPTY>';
      p := xmlparser.newParser;
      xmlparser.parseDTDBuffer(p,v,'Department');
      xmlparser.setDoctype(p,xmlparser.getDoctype(p));
      xmlparser.setValidationMode(p,TRUE);
      xmlparser.parseClob(p,good);
      xmlparser.parseClob(p,bad);
      xmlparser.freeParser (p);
    EXCEPTION
      WHEN xml_parse_error THEN
         DBMS_OUTPUT.PUT_LINE(sqlerrm);
         xmlparser.freeParser (p);
    END;

  • Problem parsing XML with schema when extracted from a jar file

    I am having a problem parsing XML with a schema, both of which are extracted from a jar file. I am using using ZipFile to get InputStream objects for the appropriate ZipEntry objects in the jar file. My XML is encrypted so I decrypt it to a temporary file. I am then attempting to parse the temporary file with the schema using DocumentBuilder.parse.
    I get the following exception:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element '<root element name>'
    This was all working OK before I jarred everything (i.e. when I was using standalone files, rather than InputStreams retrieved from a jar).
    I have output the retrieved XML to a file and compared it with my original source and they are identical.
    I am baffled because the nature of the exception suggests that the schema has been read and parsed correctly but the XML file is not parsing against the schema.
    Any suggestions?
    The code is as follows:
      public void open(File input) throws IOException, CSLXMLException {
        InputStream schema = ZipFileHandler.getResourceAsStream("<jar file name>", "<schema resource name>");
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = null;
        try {
          factory.setNamespaceAware(true);
          factory.setValidating(true);
          factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
          factory.setAttribute(JAXP_SCHEMA_SOURCE, schema);
          builder = factory.newDocumentBuilder();
          builder.setErrorHandler(new CSLXMLParseHandler());
        } catch (Exception builderException) {
          throw new CSLXMLException("Error setting up SAX: " + builderException.toString());
        Document document = null;
        try {
          document = builder.parse(input);
        } catch (SAXException parseException) {
          throw new CSLXMLException(parseException.toString());
        }

    I was originally using getSystemResource, which worked fine until I jarred the application. The problem appears to be that resources returned from a jar file cannot be used in the same way as resources returned directly from the file system. You have to use the ZipFile class (or its JarFile subclass) to locate the ZipEntry in the jar file and then use ZipFile.getInputStream(ZipEntry) to convert this to an InputStream. I have seen example code where an InputStream is used for the JAXP_SCHEMA_SOURCE attribute but, for some reason, this did not work with the InputStream returned by ZipFile.getInputStream. Like you, I have also seen examples that use a URL but they appear to be URL's that point to a file not URL's that point to an entry in a jar file.
    Maybe there is another way around this but writing to a file works and I set use File.deleteOnExit() to ensure things are tidied afterwards.

  • Validate XML with XSD

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    with the partitioning, real application clusters, olap, data mining
    and Real Application Testing options
    Working with relational tables containing clob type columns (no XMLDB available) I'm not able to set up a simple validation example as below (supposed to return 1 confirming a successful validation).
    declare
      xmldoc xmltype;
      sb_xml xmltype;
      valid_ number;
      xmlxsd varchar2(4000) := q'~<?xml version="1.0" ?>
                                  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
                                  <xs:element name="greeting" type="xs:string" />
                                  </xs:schema>~';
      xmlxml varchar2(32767) := q'~<?xml version="1.0" ?><greeting>"HELLO !"</greeting>~';
    begin
      xmldoc := xmltype(xmlxml);
      sb_xml := xmldoc.createschemabasedxml();
      valid_ := sb_xml.isschemavalid(xmlxsd);
      dbms_output.put_line('IsSchemaValid (0=false,1=true): ' || to_char(valid_));
    end;Thanks in advance for any kind of help provided
    Etbin

    no XMLDB availablenot sure if it will work without xmldb, but you might try to use java for schema validation:
    SQL> CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "SchemaUtil"
      2  as
      3
      4  import oracle.xml.parser.schema.*;
      5  import oracle.xml.parser.v2.*;
      6  import oracle.sql.CHAR;
      7  import java.io.*;
      8
      9  public class SchemaUtil
    10  {
    11     public static String validation(CHAR xml, CHAR xsd)
    12     throws Exception
    13     {
    14        //Build Schema Object
    15        XSDBuilder builder = new XSDBuilder();
    16        byte [] docbytes = xsd.getBytes();
    17        ByteArrayInputStream in = new   ByteArrayInputStream(docbytes);
    18        XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
    19        //Parse the input XML document with Schema Validation
    20        docbytes = xml.getBytes();
    21        in = new ByteArrayInputStream(docbytes);
    22        DOMParser dp  = new DOMParser();
    23        // Set Schema Object for Validation
    24        dp.setXMLSchema(schemadoc);
    25        dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    26        dp.setPreserveWhitespace (true);
    27        StringWriter sw = new StringWriter();
    28        dp.setErrorStream (new PrintWriter(sw));
    29        try
    30        {
    31           dp.parse (in);
    32           sw.write("The input XML parsed without errors.\n");
    33        }
    34        catch (XMLParseException pe)
    35        {
    36             sw.write("Parser Exception: " + pe.getMessage());
    37          }
    38        catch (Exception e)
    39          {
    40             sw.write("NonParserException: " + e.getMessage());
    41          }
    42          return sw.toString();
    43     }
    44   }
    45  /
    Java created.
    SQL>
    SQL> create or replace function schemavalidation(xml in varchar2,xsd in varchar2)
      2  return varchar2 is language java name 'SchemaUtil.validation(oracle.sql.CHAR,oracle.sql.CHAR)
      3                   returns java.lang.String';
      4  /
    Function created.
    SQL>
    SQL> select schemavalidation('<?xml version="1.0" ?><greeting>"HELLO !"</greeting>',
      2                           '<?xml version="1.0" ?>
      3                          <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      4                          <xs:element name="greeting" type="xs:string" />
      5                          </xs:schema>') schemavalidation from dual
      6  /
    SCHEMAVALIDATION
    The input XML parsed without errors.
    SQL>

  • How to validate XML against Schema

    Hi,
    I am trying to validate the XML against the schema by using follywing code but i am never getting errors in parser it always passes the parser even though there are serious parsing problems. My code is as follows:
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(true);
    spf.setValidating(true);
    SAXParser sp = spf.newSAXParser();
    sp.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
    "http://www.w3.org/2001/XMLSchema");
    sp.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", xsdPath);
    DefaultHandler dh = new DefaultHandler();
    sp.parse(splObjPath, dh);
    thanks

    Many ways to do this... also depending upon what version of Xerces and/or you want to do DTD or schema, etc one of the simplest is to set the following properties,
    refer to:
    http://xerces.apache.org/xerces2-j/features.html
    Scroll down, check all the features starting with "http://apache.org/xml/features/validation"

  • Partial Validation of XML with Schema

    This might be a quick question with a 'yes' or 'no' answer.
    What I have is a large XML file. It has various tags that are headers to keep groups of information together. I want to create an XML Schema that validates only one section of the overall larger XML file.
    First, is this possible to do, and if so, how exactly do I go about doing it?????
    Any code would be great, but if there I think it would be more useful to see how the XSL might be defined.
    <root>
    <section1>
    </section1>
    <section2>
    <!-- How would I define a W3C Schema to validate only this section? -->
    </section2>
    <section3>
    </section3>
    </root>
    Again, any help would be much appreciated?
    Thanks.
    Tom

    The existing schema validation doesn't let you do that... however you sure can get around it. I wrote some program that let you validate one field at a time, or one record at a time rather than whole document.
    I did so by using directly the DataTypeValidator inside org.apache.xerces.validators.*... it requires some coding, because you will have to write your own validator and some sort of filter... but you should look at the codes in that package to get a better understanding.

  • Validate XML with XSD Puntuaction Marks

    Hello all,
    I am trying to validate a XML document against a registered XML schema. The XML document contains punctuation marks (like ã, ç, õ) which cause the validation to fail. How to overcome this?
    I suspect of the encoding format the XSD and XML documents are using, encoding=UTF-8, right?
    Thank you,
    Pedro.

    Ok... just needed to change the enconding attribute of the XML document to the value of the parameter NLS_CHARACTERSET of my database.
    Unnecessary post. :-o)

  • Validate XML with multiple XML Sechme in the same namespace

    In my program, i use multiple xml schemas to validate against my xml files.
    However, i found the following code do not work because all schemas in the same namespace.
    Does any one have some solutions to validate multiple XML Schemas in the same namespace?
    Thanks~~
    static final String[] schemas = { partyInformationSchema,
    itemInformationSchema,
    exceptionsSchema,
    salesForecastSchema,
    exceptionCriteriaSchema };
    factory.setAttribute(JAXP_SCHEMA_SOURCE, schemas);

    I have used the Object arrsy too, but it didn't work.
    static final Object[] schemas = { partyInformationSchema,
    itemInformationSchema,
    exceptionsSchema,
    salesForecastSchema,
    exceptionCriteriaSchema };

Maybe you are looking for

  • How do I delete mobile account which is no longer ...

    A couple of months ago I closed my BT mobile account.  When l log on to MyBT to look at my landline/broadband account, the account shown first is the old mobile account so I have to reselect landline and wait for it to change.   Can I either delete t

  • Transfer activation of CS2 from XP pc to WIN7 pc fails

    So frustrating, no I am not going to upgrade.. I had to get a new computer.. this one is WIN7 which I hate, the old was XPpro. Everytime I start Photoshop CS2 it displays the register popup. I try and it fails, registration server offine. I did some

  • MacBook Pro freezes every 15 minutes after Mavericks upgrade

    After upgrading to OS X 10.9.3 my computer freezes every 15 or so minutes in the middle of working.  The keyboard and touch pad stop working and the mouse curser disappears.  I'm using Ableton audio software and the audio will continue playing and lo

  • Need advice for a new graphics card

    Hey this is my first time posting here. I've got a Power Mac G4 MDD 1.25GHz with the original ATI Radeon 9000 Pro. I just recently tried installing Final Cut Suite 2 and found out my card isn't good enough. I've tried doing some research into what I

  • Downstream Archivelog files

    I am setting up streams with downstream capture. I have archive logs being posted to the ASM filestore on the downstream database (through log_archive_dest_2 set on primary). These downstream logs are mounting up and I can;t seem to find a way of lis