You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Sparkes <pe...@didm.co.uk> on 2006/04/10 14:57:20 UTC

CForms Samples - saveDocument() function

Hi,

I am using both loadDocument(uri) and saveDocument(document, uri) 
functions from the CForm samples in webapp\samples\blocks\forms\flow. 
The loadDocument(uri) functions loads xml documents together with their 
document type declarations, however the saveDocument(document, uri) 
function saves the documents without their document type declarations.

Does anyone, please, have a javascript function which will save xml 
documents (DOM) with their document type declarations.

Thank you

Peter Sparkes


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms Samples - saveDocument() function

Posted by Peter Sparkes <pe...@didm.co.uk>.
Hi Jeroen,

Thanks, following up your advice and after looking at 
http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/OutputKeys.html
I tried
transformer.setOutputProperty(Packages.javax.xml.transform.OutputKeys.DOCTYPE_SYSTEM, 
"marker.dtd");

However it does not insert the document type declaration in the saved 
document.

Regards

Peter

> Hi Peter,
>
> I'm not completely sure but I guess you can change the function to 
> ouput the document type?
> You can probably do this by adding an OutputProperty to the 
> TransformerFactory.
>
> I guess it should look something like:
>
> transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "doctype");
>
> I hope this helps.
>
> Regards,
>
> Reijn
>
> Peter Sparkes wrote:
>
>> Hi,
>>
>> I am using both loadDocument(uri) and saveDocument(document, uri) 
>> functions from the CForm samples in webapp\samples\blocks\forms\flow. 
>> The loadDocument(uri) functions loads xml documents together with 
>> their document type declarations, however the saveDocument(document, 
>> uri) function saves the documents without their document type 
>> declarations.
>>
>> Does anyone, please, have a javascript function which will save xml 
>> documents (DOM) with their document type declarations.
>>
>> Thank you
>>
>> Peter Sparkes
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms Samples - saveDocument() function

Posted by Jeroen Reijn <j....@hippo.nl>.
Hi Peter,

I'm not completely sure but I guess you can change the function to ouput the document type?
You can probably do this by adding an OutputProperty to the TransformerFactory.

I guess it should look something like:

transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "doctype");

I hope this helps.

Regards,

Reijn

Peter Sparkes wrote:
> Hi,
> 
> I am using both loadDocument(uri) and saveDocument(document, uri) 
> functions from the CForm samples in webapp\samples\blocks\forms\flow. 
> The loadDocument(uri) functions loads xml documents together with their 
> document type declarations, however the saveDocument(document, uri) 
> function saves the documents without their document type declarations.
> 
> Does anyone, please, have a javascript function which will save xml 
> documents (DOM) with their document type declarations.
> 
> Thank you
> 
> Peter Sparkes
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
Met vriendelijke groet,
Kind regards,

Jeroen Reijn

Hippo

Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org