DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Noga Atsil Guest

    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.

  2. #2
    Chris F. Guest

    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.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links