Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Fri, 29 Feb 2008 06:46:03 -0800,    group: microsoft.public.xsl        back       


How can provide an external XSD to an XML   
Hi all,

How can I provide an external XSD to an XML? What kind of line should be 
added to the XML

Clara


-- 
thank you so much for your help
date: Fri, 29 Feb 2008 06:46:03 -0800   author:   clara

Re: How can provide an external XSD to an XML   
clara wrote:

> How can I provide an external XSD to an XML? What kind of line should be 
> added to the XML

Do you want to link an XML instance document to a schema? You can use 
the xsi:noNamespaceSchemaLocation e.g.
   <root
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://example.com/schema.xsd">

     <foo>bar</foo>
   </root>
for that respectively xsi:schemaLocation
   <root
     xmlns="http://example.com/2008/ns1"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://example.com/2008/ns1 
http://example.com/schema.xsd">

     <foo>bar</foo>
   </root>




-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Fri, 29 Feb 2008 16:05:02 +0100   author:   Martin Honnen

Re: How can provide an external XSD to an XML   
Hi Martin,

thanks for your reply, could you explain why there are two https in the 
<xsi:schemaLoaction="..."> part. 
<root
     xmlns="http://example.com/2008/ns1"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://example.com/2008/ns1 
     http://example.com/schema.xsd">

     <foo>bar</foo>
   </root>

It seems to me that the schema is applied to the <root> element( I am newbie 
so I am not sure about it), could you show me how to apply it to whole XML 
file?

Clara


  
-- 
thank you so much for your help


"Martin Honnen" wrote:

> clara wrote:
> 
> > How can I provide an external XSD to an XML? What kind of line should be 
> > added to the XML
> 
> Do you want to link an XML instance document to a schema? You can use 
> the xsi:noNamespaceSchemaLocation e.g.
>    <root
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      xsi:noNamespaceSchemaLocation="http://example.com/schema.xsd">
> 
>      <foo>bar</foo>
>    </root>
> for that respectively xsi:schemaLocation
>    <root
>      xmlns="http://example.com/2008/ns1"
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      xsi:schemaLocation="http://example.com/2008/ns1 
> http://example.com/schema.xsd">
> 
>      <foo>bar</foo>
>    </root>
> 
> 
> 
> 
> -- 
> 
> 	Martin Honnen --- MVP XML
> 	http://JavaScript.FAQTs.com/
>
date: Fri, 29 Feb 2008 08:19:02 -0800   author:   clara

Re: How can provide an external XSD to an XML   
clara wrote:

> thanks for your reply, could you explain why there are two https in the 
> <xsi:schemaLoaction="..."> part. 

There are two URIs, the first is the namespace URI, the second points to 
the schema for that namespace.


> It seems to me that the schema is applied to the <root> element( I am newbie 
> so I am not sure about it), could you show me how to apply it to whole XML 
> file?

The schema location is given on the root element, that is right, but the 
schema applies to the complete document.

See <URL:http://www.w3.org/TR/xmlschema-0/#schemaLocation> for a more 
detailed explanation.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Fri, 29 Feb 2008 18:31:29 +0100   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us