all groups > dotnet xml > march 2006 >
You're in the

dotnet xml

group:

Additional properties of attributes in XSD



Re: Additional properties of attributes in XSD Martin Honnen
3/1/2006 8:33:56 PM
dotnet xml:

[quoted text, click to view]

If you want to allow attributes then the element has complex type e.g.
<xs:element name="ClaimNumber">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="mycustomproperty" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>


You could now have e.g.
<ClaimNumber mycustomproperty="Kibo">Xibo</ClaimNumber>
in your XML instance document.


I hope this is what you are looking for, not sure whether you want the
above or whether you want to define additional attributes on schema
elements itself.


--

Martin Honnen --- MVP XML
Additional properties of attributes in XSD Abdullah Kauchali
3/1/2006 9:23:27 PM
How does one define additional attributes for elements in an XSD?

So, I'd like something like this:

....
<xs:element name="ClaimNumber" type="xs:string"
mycustomproperty="xs:string"/>
....

Ideally, I'd like Visual Studio (2005) to allow the entry of these
"additional properties" while designing it.

Any ideas?

Kind regards,

Re: Additional properties of attributes in XSD Abdullah Kauchali
3/1/2006 11:07:45 PM
[quoted text, click to view]


Hi Martin!

Thanks for responding. The above is not what I am looking for ...


[quoted text, click to view]

.... it's the latter: looking for ways to define additional attributes
on the schema elements itself. :)

So, if a new schema is being created, I'd like the user to have the
opportunity to enter values in the schema for "mycustomproperty". (Not
in the XML file, but in the schema.)

Re: Additional properties of attributes in XSD Stan Kitsis [MSFT]
3/2/2006 11:33:56 AM
Hi Abdullah,

You can do it in VS. Here's an example:

<?xml version="1.0" encoding="utf-8" ?>

<xs:schema targetNamespace="myNS"

elementFormDefault="qualified"

xmlns="myNS"

xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns:vs
="http://schemas.microsoft.com/Visual-Studio-Intellisense">

<xs:element name="foo" vs:help="help"/>

</xs:schema>


--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


[quoted text, click to view]

Re: Additional properties of attributes in XSD Abdullah Kauchali
3/3/2006 6:10:38 PM
[quoted text, click to view]


Thanks Stan! Exactly what I needed.

So, I can create my own namespace definition file with all the relevant
attributes, but one last (minor) question:

Is there any way for Visual Studio to allow entering of these
"properties" in "Designer view"? The intellisense works when viewing
the code, but no additional properties are visible besides the usual.

Any ideas?
Re: Additional properties of attributes in XSD Stan Kitsis [MSFT]
3/6/2006 2:24:47 PM
I don't think the design view surfaces visual support for this.

--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

[quoted text, click to view]

Re: Additional properties of attributes in XSD Abdullah Kauchali
3/7/2006 9:28:41 PM
[quoted text, click to view]


AddThis Social Bookmark Button