OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xml-dev] xml schema trouble



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 XML Spy, 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>