BizTalk Server General - Urgent - Help in Creating schema

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > December 2005 > Urgent - Help in Creating schema





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Urgent - Help in Creating schema
MNA

2005-12-28, 5:58 pm

I am desperate. Can anyone please help in creating the schema which can
validate following XML?

<?xml version="1.0" ?>
<g:propertyupdate xmlns:g="DAV:"
xmlns:e="http://schemas.microsoft.com/exchange/"
xmlns:x="xml:">
<g:set>
<g:prop>
<e:keywords-utf8>
<x:v>Buddies</x:v>
<x:v>Engineers</x:v>
</e:keywords-utf8>
</g:prop>
</g:set>
</g:propertyupdate>


Any help will be highly appreciated

Jay Kinker

2005-12-29, 2:49 am

Try this,

Create 3 schema files on same directory with below mentioned file names. You
may change the names of files or any other attribute name as per your
requirement.

----------------------------------------------
Main.xsd
---------------------------------------------
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:g="DAV:" xmlns:e="http://schemas.microsoft.com/exchange/"
xmlns:x="xml:" xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="DAV:" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation=".\Schema_Ref1.xsd"
namespace="http://schemas.microsoft.com/exchange/" />
<xs:annotation>
<xs:appinfo>
<b:schemaInfo root_reference="propertyupdate" document_type="DocType"
schema_type="document" />
</xs:appinfo>
</xs:annotation>
<xs:element name="propertyupdate">
<xs:complexType>
<xs:sequence>
<xs:element name="set">
<xs:complexType>
<xs:sequence>
<xs:element name="prop">
<xs:complexType>
<xs:sequence>
<xs:element ref="e:keywords-utf8" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
---------------------------------------------------------------------------------


Schema_Ref1.xsd
---------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.microsoft.com/exchange/"
attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://schemas.microsoft.com/exchange/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation=".\Schema_Ref2.xsd" namespace="xml:" />
<xs:element name="keywords-utf8">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" xmlns:q1="xml:" ref="q1:v" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
---------------------------------------------------------------------------------


Schema_Ref2.xsd
---------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="xml:" attributeFormDefault="unqualified"
elementFormDefault="qualified" targetNamespace="xml:"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="v" type="xs:string" />
</xs:schema>
---------------------------------------------------------------------------------


Regards,

Jay Kinker.




---------------------------------------------------------------------------------


"MNA" wrote:

> I am desperate. Can anyone please help in creating the schema which can
> validate following XML?
>
> <?xml version="1.0" ?>
> <g:propertyupdate xmlns:g="DAV:"
> xmlns:e="http://schemas.microsoft.com/exchange/"
> xmlns:x="xml:">
> <g:set>
> <g:prop>
> <e:keywords-utf8>
> <x:v>Buddies</x:v>
> <x:v>Engineers</x:v>
> </e:keywords-utf8>
> </g:prop>
> </g:set>
> </g:propertyupdate>
>
>
> Any help will be highly appreciated
>
>

MNA

2005-12-29, 5:55 pm

Thanks Jay!
I am getting this exception

This schema is an invalid XSD Schema and has the following error(s):
1. Cannot resolve schemaLocation attribute. An error occurred at
file:///C:/Work/exchange/CreateContacts/testing/main.xsd, (5, 4).
2. The 'http://schemas.microsoft.com/exchange/:keywords-utf8' element
is not declared. An error occurred at
file:///C:/Work/exchange/CreateContacts/testing/main.xsd, (22, 22).

Any suggestion?

Thanks in advance

Jay Kinker wrote:[vbcol=seagreen]
> Try this,
>
> Create 3 schema files on same directory with below mentioned file names. You
> may change the names of files or any other attribute name as per your
> requirement.
>
> ----------------------------------------------
> Main.xsd
> ---------------------------------------------
> <?xml version="1.0" encoding="utf-16"?>
> <xs:schema xmlns:g="DAV:" xmlns:e="http://schemas.microsoft.com/exchange/"
> xmlns:x="xml:" xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="DAV:" xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:import schemaLocation=".\Schema_Ref1.xsd"
> namespace="http://schemas.microsoft.com/exchange/" />
> <xs:annotation>
> <xs:appinfo>
> <b:schemaInfo root_reference="propertyupdate" document_type="DocType"
> schema_type="document" />
> </xs:appinfo>
> </xs:annotation>
> <xs:element name="propertyupdate">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="set">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="prop">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="e:keywords-utf8" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> ---------------------------------------------------------------------------------
>
>
> Schema_Ref1.xsd
> ---------------------------------------------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema xmlns:tns="http://schemas.microsoft.com/exchange/"
> attributeFormDefault="unqualified" elementFormDefault="qualified"
> targetNamespace="http://schemas.microsoft.com/exchange/"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:import schemaLocation=".\Schema_Ref2.xsd" namespace="xml:" />
> <xs:element name="keywords-utf8">
> <xs:complexType>
> <xs:sequence>
> <xs:element maxOccurs="unbounded" xmlns:q1="xml:" ref="q1:v" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> ---------------------------------------------------------------------------------
>
>
> Schema_Ref2.xsd
> ---------------------------------------------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema xmlns:tns="xml:" attributeFormDefault="unqualified"
> elementFormDefault="qualified" targetNamespace="xml:"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="v" type="xs:string" />
> </xs:schema>
> ---------------------------------------------------------------------------------
>
>
> Regards,
>
> Jay Kinker.
>
>
>
>
> ---------------------------------------------------------------------------------
>
>
> "MNA" wrote:
>

Jay Kinker

2005-12-30, 2:49 am

I think you are using some different file names other than what i mentioned
in my reply. It should work perfectlly if you had kept all the files in same
folder and created all the files with the names I stated.

Anways...., If you want to change the file name or file location, check out
the attribute "schemaLocation" in Main.xsd. Its value is ".\Schema_Ref1.xsd".
If you want file name to be different from "Schema_Ref1", then you also need
to update this attribute in Main.xsd.

Note : "schemaLocation" attribute is also present in "Schema_Ref1.xsd".

This sould do the trick...

Don't forget to mark this question as answered.

Regards,

Jay Kinker

------------------------------------------------------------------

"MNA" wrote:

> Thanks Jay!
> I am getting this exception
>
> This schema is an invalid XSD Schema and has the following error(s):
> 1. Cannot resolve schemaLocation attribute. An error occurred at
> file:///C:/Work/exchange/CreateContacts/testing/main.xsd, (5, 4).
> 2. The 'http://schemas.microsoft.com/exchange/:keywords-utf8' element
> is not declared. An error occurred at
> file:///C:/Work/exchange/CreateContacts/testing/main.xsd, (22, 22).
>
> Any suggestion?
>
> Thanks in advance
>
> Jay Kinker wrote:
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com