Referencing the xml: namespace in BTS2004
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Referencing the xml: namespace in BTS2004




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Referencing the xml: namespace in BTS2004  
vsiwc


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-23-04 09:35 PM

I need to validate XML documents where some of the elements carry the xml:lang attribut
e (see http://www.w3.org/XML/1998/namespace).  My starting point is the DTD 
below.  I add this as a generated item to get the xsd below.  This xsd fails
 validation, wit
h error message:

C:...<snip>...xsd Node "<Schema>" - Schema reference "xml.xsd" is not a vali
d reference or does not exist in the current project."

The only workaround I found was to add a file "xml.xsd" to the project, even
 if it's completely empty.  TurboXML suggested taking out schemaLocation="xm
l.xsd" but BTS2004 still wouldn't validate that.

Is there a better way?

Wil

DTD:
<!ELEMENT root (Name , Age)><!ATTLIST root  xml:lang CDATA  #REQUIRED ><!ELE
MENT Name (#PCDATA)><!ELEMENT Age (#PCDATA)>


xsd:
<?xml version="1.0" encoding="utf-16"?><xs:schema elementFormDefault="qualif
ied" xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:import schemaLocation="
xml.xsd" namespace="http://www.w3.org/XML/1998/namespace" /><xs:element name
="Age" type="xs:string" /><
xs:element name="root"><xs:complexType><xs:sequence><xs:element ref="Name" /
><xs:element ref="Age" /></xs:sequence><xs:attribute ref="xml:lang" /></xs:c
omplexType></xs:element><xs:element name="Name" type="xs:string" /></xs:sche
ma>





[ Post a follow-up to this message ]



    RE: Referencing the xml: namespace in BTS2004  
Shaheer Abubucker


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-28-04 10:36 PM

Wil,

I looked into this and you can get the xml.xsd that you need from
http://www.w3.org/2001/xml.xsd

This is the xsd file that contains the definitions for xml:lang, xml:base,
and xml:space and references XMLSchemas.dtd which references doctypes.dtd.
This gives you everything you need to use xml:lang.

After saving this file to your project folder, you will have to change the
"XMLSchema.dtd" in the second line to
"http://www.w3.org/2001/XMLSchema.dtd" so that you don't need the
referenced files locally..

You need to then add the xml.xsd file to your project.  You should then be
able to validate your xsd file and also xml.xsd and you should now be able
to build with no errors.

I also generated the following XML instance and validated it against the
DTD (using XML Spy) and the generated XSD (in BTS 2004) to verify that the
generated XSD was equivalent to the original DTD.

<?xml version="1.0" encoding="UTF-8" ?>
<root xml:lang="en">
<Name>Text</Name>
<Age>Text</Age>
</root>

Thanks,
Shaheer Abubucker
Microsoft Biztalk Server Team
This posting is provided "AS IS" with no warranties,and confers no rights.
Subscribe at
http://support.microsoft.com/defaul...msdn/nospam.asp
&SD=msdn



--------------------
| Thread-Topic: Referencing the xml: namespace in BTS2004
| X-Tomcat-NG: microsoft.public.biztalk.general
|
| I need to validate XML documents where some of the elements carry the
xml:lang attribute (see http://www.w3.org/XML/1998/namespace).  My starting
point is the DTD below.  I add this as a generated item to get the xsd
below.  This xsd fails validation, with error message:

C:...<snip>...xsd Node "<Schema>" - Schema reference "xml.xsd" is not a
valid reference or does not exist in the current project."

The only workaround I found was to add a file "xml.xsd" to the project,
even if it's completely empty.  TurboXML suggested taking out
schemaLocation="xml.xsd" but BTS2004 still wouldn't validate that.

Is there a better way?

Wil

DTD:
<!ELEMENT root (Name , Age)><!ATTLIST root  xml:lang CDATA  #REQUIRED
><!ELEMENT Name (#PCDATA)><!ELEMENT Age (#PCDATA)>


xsd:
<?xml version="1.0" encoding="utf-16"?><xs:schema
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:import
schemaLocation="xml.xsd" namespace="http://www.w3.org/XML/1998/namespace"
/><xs:element name="Age" type="xs:string" /><xs:element
name="root"><xs:complexType><xs:sequence><xs:element ref="Name"
/><xs:element ref="Age" /></xs:sequence><xs:attribute ref="xml:lang"
/></xs:complexType></xs:element><xs:element name="Name" type="xs:string"
/></xs:schema>
|






[ Post a follow-up to this message ]



    Re: Referencing the xml: namespace in BTS2004  
vsiwc


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-30-04 10:35 PM

Re-posting without the attachment, 120KB appears to be too much to post.
=================
Thanx a ton Shaheer, this gets me 75% of the way there.  The other 25%
appears to have to do with the fact that BTS2004 is treating the xml:
namesace as any other namespace instead of the reserved namespace the W3C
intended.  Take a look at a sample message I'm getting out of a schema
(ignore the values, they're all made up):

<ns0:SIF_Message Version="1.1"
xmlns:ns1="http://www.w3.org/XML/1998/namespace"
xmlns:ns0=http://visualsi.com/B2BSolution>
<ns0:SIF_Ack>
<ns0:SIF_Status>
<ns0:SIF_Data>
<ns0:SIF_Message Version="1.1" />
</ns0:SIF_Data>
</ns0:SIF_Status>
</ns0:SIF_Ack>
<ns0:SIF_Event>
<ns0:SIF_ObjectData>
<ns0:Assessment ns1:lang="en">
<ns0:Title>lunguw</ns0:Title>
<ns0:AssessmentType>Meshuaw</ns0:AssessmentType>
<ns0:AssessmentInstanceForm>lunguw, gaeplu</ns0:AssessmentInstanceForm>
<ns0:AssessmentComment>82</ns0:AssessmentComment>
<ns0:PauseFlag>641</ns0:PauseFlag>
<ns0:Objective>8/10/1990</ns0:Objective>
<ns0:Rubric>
<ns0:Criterion>M</ns0:Criterion>
</ns0:Rubric>
</ns0:Assessment>
</ns0:SIF_ObjectData>
</ns0:SIF_Event>
</ns0:SIF_Message>

What I had expected was for only one namespace to be defined
(xmlns=http://visualsi.com/B2BSolution), for all the tags to be namespace
unqualified, except for the "lang" attribute qualified to the special xml:
namespace (which doesn't need an xmlns declaration).

I am sure the xml above will break some of my clients' applications.  Is
there any hope of "improving" on it?  I am including in this posting to the
newsgroup a zip of my project and a file drop directory.

Thanx!

Wil

"Shaheer Abubucker" <shaheera@online.microsoft.com> wrote in message
news:JvJIddWLEHA.928@cpmsftngxa10.phx.gbl...
> Wil,
>
> I looked into this and you can get the xml.xsd that you need from
> http://www.w3.org/2001/xml.xsd
>
> This is the xsd file that contains the definitions for xml:lang, xml:base,
> and xml:space and references XMLSchemas.dtd which references doctypes.dtd.
> This gives you everything you need to use xml:lang.
>
> After saving this file to your project folder, you will have to change the
> "XMLSchema.dtd" in the second line to
> "http://www.w3.org/2001/XMLSchema.dtd" so that you don't need the
> referenced files locally..
>
> You need to then add the xml.xsd file to your project.  You should then be
> able to validate your xsd file and also xml.xsd and you should now be able
> to build with no errors.
>
> I also generated the following XML instance and validated it against the
> DTD (using XML Spy) and the generated XSD (in BTS 2004) to verify that the
> generated XSD was equivalent to the original DTD.
>
>  <?xml version="1.0" encoding="UTF-8" ?>
>  <root xml:lang="en">
>   <Name>Text</Name>
>   <Age>Text</Age>
>   </root>
>
> Thanks,
> Shaheer Abubucker
> Microsoft Biztalk Server Team
> This posting is provided "AS IS" with no warranties,and confers no rights.
> Subscribe at
>
http://support.microsoft.com/defaul...msdn/nospam.asp
> &SD=msdn
>
>
>
> --------------------
> | Thread-Topic: Referencing the xml: namespace in BTS2004
> | X-Tomcat-NG: microsoft.public.biztalk.general
> |
> | I need to validate XML documents where some of the elements carry the
> xml:lang attribute (see http://www.w3.org/XML/1998/namespace).  My
starting
> point is the DTD below.  I add this as a generated item to get the xsd
> below.  This xsd fails validation, with error message:
>
> C:...<snip>...xsd Node "<Schema>" - Schema reference "xml.xsd" is not a
> valid reference or does not exist in the current project."
>
> The only workaround I found was to add a file "xml.xsd" to the project,
> even if it's completely empty.  TurboXML suggested taking out
> schemaLocation="xml.xsd" but BTS2004 still wouldn't validate that.
>
> Is there a better way?
>
> Wil
>
> DTD:
> <!ELEMENT root (Name , Age)><!ATTLIST root  xml:lang CDATA  #REQUIRED 
>
>
> xsd:
> <?xml version="1.0" encoding="utf-16"?><xs:schema
> elementFormDefault="qualified"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:import
> schemaLocation="xml.xsd" namespace="http://www.w3.org/XML/1998/namespace"
> /><xs:element name="Age" type="xs:string" /><xs:element
> name="root"><xs:complexType><xs:sequence><xs:element ref="Name"
> /><xs:element ref="Age" /></xs:sequence><xs:attribute ref="xml:lang"
> /></xs:complexType></xs:element><xs:element name="Name" type="xs:string"
> /></xs:schema>
> |
>











[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:14 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register