Hi, Michiel.
Michiel Meeuwissen <[EMAIL PROTECTED]> wrote on 2005-04-24
05:35:03 PM:
> I'm trying to use an XSL to tranform a DOM tree which was
> programaticly created.
> which goes appr. like this:
> DOMImplementation impl = documentBuilder.getDOMImplementation();
> this.document = impl.createDocument(NAMESPACE, "objects",
> impl.createDocumentType("objects", DOCUMENTTYPE_PUBLIC,
> DOCUMENTTYPE_SYSTEM));
> this.document.getDocumentElement().setAttribute("xmlns", NAMESPACE);
>
[Removed stylesheet copying DOM to intermediate file.]
>
> But if then I don't use this intermediate file, but feed the Document
> directory into the transformer, i have to ignore namespaces after the
> first match:
>
> <xsl:template match="o:objects">
> <div class="objects">
> <xsl:apply-templates select="object[1]" />
> </div>
> </xsl:template>
>
> I completely don't understand this. Why is my inner element of a
> different namespace, and why was this not reflected in my
> serialization?
I don't understand it either, because I was not able to reproduce the
problem. You didn't show how your "object" element was created. In my
test program, I created an "object" element like this:
document.getDocumentElement()
.appendChild(document.createElementNS(NAMESPACE,
"object"));
If your program creates an "object" element in the same way, could I
ask you to open a bug report in Jira and attach a complete standalone test
case (Java and any stylesheet) that demonstrates the problem?
Thanks,
Henry
------------------------------------------------------------------
Henry Zongaro Xalan development
IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]