XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Jon GallegosSubject: One file in, two files out
Author: Jon Gallegos
Date: 01 Dec 2009 08:44 AM
Is there a way I can take one input xml file and create two output xml files?

Postnext
Alberto MassariSubject: One file in, two files out
Author: Alberto Massari
Date: 01 Dec 2009 09:12 AM
Only by using XSLT 2.0 and its xsl:result-document, or by using XQuery (saxon:result-document or ddtek:serialize)

Alberto

Postnext
Jon GallegosSubject: One file in, two files out
Author: Jon Gallegos
Date: 01 Dec 2009 09:14 AM
Is there a link where I can see an example?

Postnext
Alberto MassariSubject: One file in, two files out
Author: Alberto Massari
Date: 01 Dec 2009 09:21 AM
XSLT 2.0 xsl:result-document: http://saxonica.com/documentation/xsl-elements/result-document.html

Saxon: http://saxonica.com/documentation/extensions/functions/result-document.html

DataDirect XQuery: http://media.datadirect.com/download/docs/ddxquery/allddxq/reference/built-in_functions2.html#wp284162

Postnext
Jon GallegosSubject: One file in, two files out
Author: Jon Gallegos
Date: 01 Dec 2009 09:22 AM
Can I do this?


<xsl:result-document href="HRACRFAttachmentFile.xml">
<document xmlns="http://www.lotus.com/dxl" version="6.5" maintenanceversion="4.0" form="Frm_D_Attach">
<noteinfo noteid="af6" sequence="1">
<created><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')"/></datetime></created>
<modified><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')" /></datetime></modified>
<revised><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')" /></datetime></revised>
<lastaccessed><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')" /></datetime></lastaccessed>
<addedtofile><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')" /></datetime></addedtofile>
</noteinfo>

<updatedby>
<name>
<xsl:value-of select="$CRFOriginatorForm/a:UserValue[@title = 'H_crfrequestassoc']/@value"/>
</name>
</updatedby>

</document>
</xsl:result-document>

Postnext
Alberto MassariSubject: One file in, two files out
Author: Alberto Massari
Date: 01 Dec 2009 10:32 AM
Sure.

Alberto

Postnext
Jon GallegosSubject: One file in, two files out
Author: Jon Gallegos
Date: 01 Dec 2009 11:14 AM
I can not get this to work. I would not be surprised if it were a typo since I am the worlds worse typist.

Will you please review to see where I went wrong?


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.plmxml.org/Schemas/PLMXMLSchema" exclude-result-prefixes="a">

<xsl:output name="HRACRFAtt" method="xml" encoding="US-ASCII" indent="no" doctype-system="example" doctype-public="example"/>

<xsl:template match="/">

<xsl:variable name="PLMXMLCRF" select="a:PLMXML"/>

<xsl:variable name="CRFOriginatorForm" select="a:PLMXML/a:Form[@subClass = 'CRF Originator Form']/a:UserData"/>

<xsl:result-document href="HRACRFAttachmentFile.xml" format="HRACRFAtt">

<document xmlns="http://www.lotus.com/dxl" version="6.5" maintenanceversion="4.0" form="Frm_D_Attach">

<noteinfo noteid="af6" sequence="1">
<created><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')"/></datetime></created>
<modified><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')" /></datetime></modified>
<revised><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')" /></datetime></revised>
<lastaccessed><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')" /></datetime></lastaccessed>
<addedtofile><datetime><xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01]')" /></datetime></addedtofile>
</noteinfo>

<updatedby>
<name>
<xsl:value-of select="$CRFOriginatorForm/a:UserValue[@title = 'H_crfrequestassoc']/@value"/>
</name>
</updatedby>

</document>
</xsl:result-document>

</xsl:template>

</xsl:stylesheet>

Postnext
Alberto MassariSubject: One file in, two files out
Author: Alberto Massari
Date: 01 Dec 2009 11:29 AM
Your stylesheet works; the only caveat is that Saxon takes as current directory the bin folder of the Stylus Studio installation, and it's there that you can find the generated file. Either use an absolute URL like file:///c:/HRACRFAttachmentFile.xml or build it against the XSL path using

<xsl:result-document href="{resolve-uri('HRACRFAttachmentFile.xml', document-uri(document('')))}" format="HRACRFAtt">

Alberto

Posttop
Jon GallegosSubject: One file in, two files out
Author: Jon Gallegos
Date: 01 Dec 2009 12:02 PM
That did the trick

thanks


 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.