This commit is contained in:
Arjen Poutsma
2008-02-06 02:38:34 +00:00
parent 4f9a152f30
commit 4d2c359606
2 changed files with 9 additions and 2 deletions

View File

@@ -223,8 +223,12 @@ public class StaxEventXmlReader extends AbstractStaxXmlReader {
if (namespace == null || !hasNamespacesFeature()) {
namespace = "";
}
attributes.addAttribute(namespace, qName.getLocalPart(), QNameUtils.toQualifiedName(qName),
attribute.getDTDType(), attribute.getValue());
String type = attribute.getDTDType();
if (type == null) {
type = "CDATA";
}
attributes.addAttribute(namespace, qName.getLocalPart(), QNameUtils.toQualifiedName(qName), type,
attribute.getValue());
}
if (hasNamespacePrefixesFeature()) {
for (Iterator i = event.getNamespaces(); i.hasNext();) {

View File

@@ -196,6 +196,9 @@ public class StaxStreamXmlReader extends AbstractStaxXmlReader {
namespace = "";
}
String type = reader.getAttributeType(i);
if (type == null) {
type = "CDATA";
}
attributes.addAttribute(namespace, reader.getAttributeLocalName(i),
QNameUtils.toQualifiedName(reader.getAttributeName(i)), type, reader.getAttributeValue(i));
}