Hello everybody,
In our product we use the Castor framework to marshal objects into an XML
Document that is parsed by an XSL processor.
Castor version 0.9.3.9 did not include any namespace attributes into the
generated XML Document. Whether this was a bug or not, we coded our XSL
files not to handle namespaces because of this.
Castor version 0.9.3.21 does include namespace attributes into the generated
XML Documents. This makes our XSLs useless, unless we go and change all our
XSLs to handle namespaces.
My question: Is there a way to
1. Tell the Castor SourceGenerator to not save the namespace URI into the
Descriptor classes?
or
2. Tell the Castor Marshalling framework to refrain creating any namespace
attributes (as was done in version 0.9.3.9 and earlier (see the startElement
code of the SAX2DOMHandler.java source below)
Thanks!
public void startElement(String name, AttributeList attributes)
{
Node parent = _parents.size()>0 ? (Node) _parents.peek() :
_document;
Document document;
if (parent instanceof Document)
document = (Document) parent;
else
document = parent.getOwnerDocument();
Element element = document.createElement(name);
int length = attributes.getLength();
for(int i=0;i<length;i++)
{
String attrName = attributes.getName(i);
if (attrName.startsWith("xmlns"))
break; // removes namespace attrs from the
generated XML Document!
element.setAttribute(attrName,
attributes.getValue(i));
}
parent.appendChild(element);
_parents.push(element);
}
**********************************
* Anton Spaans *
* Sr. Software Engineer *
* SmartTime Software, Inc. *
* 10 Speen Street, *
* Framingham, MA 01701 *
* *
* Tel : +1.508.5983860 *
* Cell : +1.617.4073663 *
* [EMAIL PROTECTED] *
* EMail: [EMAIL PROTECTED] *
* ICQ : 16251359 *
**********************************
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev