Altova Mailing List Archives


Re: [xml-dev] xml schema trouble

From: Francis Norton <francis@-------.--->
To: Ian Rogers <ian.rogers@------.--.-->
Date: 9/14/2001 2:53:00 AM
Ian,

XML Schema is not as mature as XSLT, so even though there is a syntax
for what you propose to do it won't have any effect for now. You need to
install an XML Schema processing tool such as MSXML4, XSV or an eval
copy of XMLSpy">XMLSpy, and initiate validation explicitly. 

The syntax for suggesting (but only suggesting - the reader chooses what
to validate a message against, not the writer) is to add an XSI
schemalocation attribute (see
http://www.w3.org/TR/2001/REC-xmlschema-0-20010502/#schemaLocation) to
your root node, eg

	<myRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
		xsi:noNamespaceSchemaLocation="AccountClosureDetails.xsd">

or

	<purchaseReport
               xmlns="http://www.example.com/Report"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.example.com/Report
               http://www.example.com/Report.xsd">

You will find the primer (http://www.w3.org/TR/xmlschema-0/) very
helpful, also the tutorial by Roger Costello at
http://www.xfront.com/xml-schema.html

Francis.

Ian Rogers wrote:
> 
> hi list
> 
> I am quite xml schemas and is having a bit of trouble
> 
> i have written an XML and XSL document and have created a schema to go with
> the xml, but my problem is, how do i validate my xml document against the
> schema i have written,
> 
> what code do i need to add to the start of the xml document after these
> lines
> <?xml version="1.0" encoding="ISO8859-1" ?>
> <?xml-stylesheet type="text/xsl" href="trans.xsl"?>
> 
> many thanks
> 
> Ian
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this elist use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.