Accessing the default value of attributes in an XML file

M

Marc A. Criley

First off, I'm an experienced software developer but new to XML, so be
gentle :)

I've put together a schema that defines optional attributes for some
of the elements. Some of these attributes have default values defined
for them in the schema.

XML files that employ that schema may of course then have entries that
omit the default-valued attributes.

How, using XPath (or some other means?) do I query for the attribute
value of those default-valued attributes that are not explicitly
provided?

The software I'm working on needs to be portable, so I'm not using
MSXML, instead Xerces and XAnal (so far).

Thanks for any assistance.

Marc A. Criley
Quadrus Corporation
www.quadruscorp.com
 
P

Philippe Poulard

Marc said:
First off, I'm an experienced software developer but new to XML, so be
gentle :)

I've put together a schema that defines optional attributes for some
of the elements. Some of these attributes have default values defined
for them in the schema.

XML files that employ that schema may of course then have entries that
omit the default-valued attributes.

How, using XPath (or some other means?) do I query for the attribute
value of those default-valued attributes that are not explicitly
provided?

It's impossible with XPath
However, it is possible with DOM :
Attr#getSpecified()
The software I'm working on needs to be portable, so I'm not using
MSXML, instead Xerces and XAnal (so far).
^^^^^ are you sure :) ? Xalan, maybe ?
Thanks for any assistance.

Marc A. Criley
Quadrus Corporation
www.quadruscorp.com


--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
 
M

Marc A. Criley

Philippe Poulard said:
It's impossible with XPath
However, it is possible with DOM :
Attr#getSpecified()

Thanks for the guidance.
^^^^^ are you sure :) ? Xalan, maybe ?

Dyslexics of the world, UNTIE! :)

Marc
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top