schema types in DOM interface?

Discussion in 'XML' started by Rob, Aug 30, 2007.

  1. Rob

    Rob Guest

    I'm defining my schema, and I set upon the idea of using xs:list for
    some situations. However, I don't see how it's helping when accessing
    the documents through DOM. I kind of imagine there would be a
    getListContent() method or something like that.

    Now that I'm thinking about it, there are really no DOM methods that
    take Text Content and convert them to simple types. Does EVERYBODY
    who uses DOM implement their own "getTextContentAsDouble(node)" (and
    Int and String and DoubleList and IntList) methods? Or is there a
    piece of the puzzle I'm missing.

    Thanks for your patience and help!

    Rob
    Rob, Aug 30, 2007
    #1
    1. Advertising

  2. Rob wrote:
    > I'm defining my schema, and I set upon the idea of using xs:list for
    > some situations. However, I don't see how it's helping when accessing
    > the documents through DOM. I kind of imagine there would be a
    > getListContent() method or something like that.
    >
    > Now that I'm thinking about it, there are really no DOM methods that
    > take Text Content and convert them to simple types. Does EVERYBODY
    > who uses DOM implement their own "getTextContentAsDouble(node)" (and
    > Int and String and DoubleList and IntList) methods? Or is there a
    > piece of the puzzle I'm missing.


    The W3C DOM (at least the Core DOM) is not aware of schema types. There
    are schema aware data models, for instance the XPathNavigator model in
    ..NET 2.0 and later is aware of schema types and provides mappings
    between XSD schema types and .NET CLR types. So there you find methods
    and properties like
    <http://msdn2.microsoft.com/en-us/library/System.Xml.XPath.XPathNavigator.ValueAsDouble.aspx>
    <http://msdn2.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.typedvalue.aspx>
    where the last property TypedValue according to the documentation "If
    the element or attribute's content is a list type, the TypedValue
    property returns an array of objects of the most appropriate .NET
    Framework Type"

    XPathNavigator in the .NET framework can be created for the fast
    read-only XPathDocument but as well for the .NET DOM implementation
    XmlDocument/XmlNode.
    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Aug 30, 2007
    #2
    1. Advertising

  3. DOM Level 3 adds some support for schemas... but yes, the traditional
    solution is to retrieve the node value as a string and then convert it
    explicitly.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
    Joseph Kesselman, Aug 30, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,497
    Markus
    Nov 23, 2005
  2. Klaus Johannes Rusch

    Re: Convert DB2 schema to XML Schema

    Klaus Johannes Rusch, Aug 6, 2003, in forum: XML
    Replies:
    0
    Views:
    549
    Klaus Johannes Rusch
    Aug 6, 2003
  3. Brett Selleck

    Schema Metadata not a Metadata Schema

    Brett Selleck, Sep 4, 2003, in forum: XML
    Replies:
    1
    Views:
    399
    Andy Dingley
    Sep 4, 2003
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,173
    Stanimir Stamenkov
    Apr 25, 2005
  5. MikeL
    Replies:
    2
    Views:
    267
    Dino Chiesa [Microsoft]
    Feb 22, 2005
Loading...

Share This Page