-
support for namespaces on attribute value
Suppose I want to create the following XML document:
<books xmlns ="myLibraryNS">
<p:book>All my sons</p:book>
</books>
And suppose I want to create a schema that describes it:
<schema xmlns="Xml-Schema namespace" xmlns ="myLibraryNS">
<element name="books">
<complexType>
....
<element name="p:book" type="string" maxOccurs="unbounded">
.....
<schema>
Now, suppose I want to load and parse the schema. Iwould use a DOM xml parser
(unless there is a schema parser you know off, which is compatible with the
last version of XML-Schema).
When I read that attribute "name", I would like to know that it's value comes
from another namespace.
My questions are:
1) Do you know of any parser that supports namespaces on attribute value?
2) If not - can you think of another way to write an XML-Schema that would
best describe the aboce XML Document, a way that doesn't require namespace
support for the attribute value?
Thanks in advance,
Noga.
-
Re: support for namespaces on attribute value
Hi Noga,
Are you using MSXML 3? There is a namespaceURI property on the node and
attribute objects that will tell you what namespace the object belongs in.
Hope that helps,
-Chris
"Noga Atsil" <nogaa@smarteam.com> wrote:
>
>Suppose I want to create the following XML document:
>
><books xmlns ="myLibraryNS">
> <p:book>All my sons</p:book>
></books>
>
>And suppose I want to create a schema that describes it:
>
><schema xmlns="Xml-Schema namespace" xmlns ="myLibraryNS">
> <element name="books">
> <complexType>
> ....
> <element name="p:book" type="string" maxOccurs="unbounded">
> .....
><schema>
>
>Now, suppose I want to load and parse the schema. Iwould use a DOM xml parser
>(unless there is a schema parser you know off, which is compatible with
the
>last version of XML-Schema).
>When I read that attribute "name", I would like to know that it's value
comes
>from another namespace.
>
>My questions are:
>1) Do you know of any parser that supports namespaces on attribute value?
>2) If not - can you think of another way to write an XML-Schema that would
>best describe the aboce XML Document, a way that doesn't require namespace
>support for the attribute value?
>
>
>Thanks in advance,
>
>Noga.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|