cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Weinger" <>
Subject DOMStreamer and namespaces
Date Thu, 26 Jul 2001 00:00:19 GMT
I have a question regarding  DOMStreamer behavior and namespaces.  My
problem appeared when I upgraded to C2b2 from C2b1.  

I have an XSP that drops a org.w3c.dom.Node generated by some legacy
code into an <xsp:expr> tag.  

If I only generate and serialize this Node I can see the results.  When
I try to transform these results in a stylesheet, the stylesheet can't
match them.  This worked fine in C2b1.  From testing I know this has
something to do with new behavior regarding namespaces.  

Can somebody please suggest a fix?
(BTW the examples below are all very brief.)

The xsp page looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
   // . . .
   org.w3c.dom.Node anode = legacyCode.getNode();

The raw XSP output looks like this:

<page xmlns:xsp="">
<question_form currentID="37" id="2" sectionID="2"
      <question id="37" text="How often do you travel outside the United
States?" type="single-select" vieworder="1">
           	<answer id="7" text="1-2 weeks" vieworder="1"></answer>
           	<answer id="8" text="3-5 weeks" vieworder="1"></answer>
	<question id="38" text="Do you play chess" type="single-select"
      	<answer id="3" text="Yes" vieworder="1"></answer>
            <answer id="4" text="No" vieworder="1"></answer>

The XSL just tries to do this:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
  <xsl:template name="catchall"
match="@*|*|text()|processing-instruction()" priority="-1">


And all that comes out is:

<page xmlns:xsp="">

If I write the "raw" result listed above directly from an XSP, the
namespaces resolve correctly, and the XSL works as expected.  My guess
is that the DOMStreamer isn't correctly identifying the namespace for
each node.  This may have something to do the way that the DOM is built;
I will investigate that.  I also know that implementing my own
DocumentFragment would help.  

However, I was wondering if anyone could tell me what has changed,
whether it's in the DOMStreamer, or whether stylesheets are handling
namespaces more strictly now.  What's going on?

Gregory Weinger
Senior Analyst
UCLA Telemedicine

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message