You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by vm...@mail.mirapoint.com on 2001/09/12 03:19:32 UTC
attribute value
Hi
I have a problem getting attribute value. I have a dtd
<!ELEMENT body (bodypart*)>
<!ELEMENT bodypart EMPTY>
<!ATTLIST bodypart
xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
xlink:href CDATA #REQUIRED
xlink:type CDATA #IMPLIED
>
i have a xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE body SYSTEM "http://com/dtd/xml/v1/body.dtd">
<body>
<bodypart xlink:type="TEXT/PLAIN"
xlink:href="http://com/wm/xml/rfc822.txt">
</bodypart>
<bodypart xlink:type="APPLICATION/OCTET-STREAM"
xlink:href="http://com/wm/mail/genimage/zz.c">
zz.c
</bodypart>
<bodypart xlink:type="APPLICATION/MSWORD"
xlink:href="http://com/wm/mail/genimage/Readme.doc">
Readme.doc
</bodypart>
</body>
what i want is value of xlink:href
like "http://com/wm/mail/genimage/Readme.doc"
my program
private void traverse (Node node) {
try {
int type = node.getNodeType();
if (type == Node.ELEMENT_NODE) {
Node child = e.getFirstChild();
if (child.getNodeType() == Node.TEXT_NODE) {
value = child.getNodeValue().toString();
}
}
NodeList children = node.getChildNodes();
if (children != null) {
for ( int i = 0; i < children.getLength(); i++)
traverse(children.item(i));
}
}
catch(Exception e) {
}
can anyone help me
thanks
vijay
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org