cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Weinger" <>
Subject [C2]ReadDOMSessionTransformer patch
Date Tue, 07 Aug 2001 20:00:36 GMT
I have a patch for a bug in the ReadDOMSessionTransformer.   

It is currently inserting an XML prolog in the middle of an XML
document, regardless of where I attempt to insert the DOM fragment. 

This is because the DOMSteamer it uses automatically fires start
document/end document events.  I saw in the mailing list where somebody
used the EmbeddedXMLPipe to catch these.  Hence, this minor patch.  

I will look further, because there may be more bugs like this in
connection with the DOMStreamer.   

Below is an example of what can happen.  

Here is the sitemap reference:

       <map:generate type="file" src="main/result.xml" /> 
       <map:transform type="readDOMsession">
            <map:parameter name="dom-name" value="formModel"/>
            <map:parameter name="trigger-element" value="body"/>
            <map:parameter name="position" value="after"/>
       <map:serialize type="xml"/>

Here is the file I'm generating from:

<?xml version="1.0" encoding="UTF-8"?>
<title>My title</title>

And here is the result:

<?xml version="1.0" encoding="UTF-8"?>
<title>My title</title>
<body/><?xml version="1.0" encoding="UTF-8"?>
<question_form currentID="37" id="2" sectionID="2"
xmlns:p3n=""><question id="37" text="How often do
you travel outside the United States?" type="single-select"
vieworder="1" xmlns:p3n="">
            <answer id="7" text="1-2 weeks" vieworder="1"/>
            <answer id="8" text="3-5 weeks" vieworder="1"/>

View raw message