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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
- Stylus Studio Technical Forum (14621)
-> - One file in, two files out (9)
-> ->One file in, two files ou...
-> ->One file in, two files ou...
-> ->One file in, two files ou...
-> ->One file in, two files ou...
-> ->One file in, two files ou...
-> ->One file in, two files ou...
-> ->One file in, two files ou...
-> ->One file in, two files ou...
-> + XMLConverter Licence (2)
-> + hide diagram pane (3)
-> + Getting error " xsl:template i... (2)
-> + How to reduce top margin in ev... (4)
-> + Can I do this with Stylus? (4)
-> + How to remove tabs in generati... (2)
-> + Maintain Support for Stylus St... (3)
-> + How to trim field to 2 decimal... (2)
-> + Recursively update node value ... (2)
-> + Compressed content in CADATA (4)
-> + Error in Converter when readin... (2)
-> + XML parser no longer working p... (5)
-> + Application failed to start (6)
-> + Web Service Call tester (14)
-> + temp directory writing issue (3)
-> + not able to set namespace defe... (2)
-> + Unable to open UBL in XSLT Map... (8)
-> - Compatability with Windows 7 (1)
-> + Stylus Studio 10 activation fa... (5)
-- Previous [661-680] [681-700] [701-720] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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
(Deleted User) Subject: One file in, two files out
Author: (Deleted User)
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
(Deleted User) Subject: One file in, two files out
Author: (Deleted User)
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
(Deleted User) Subject: One file in, two files out
Author: (Deleted User)
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
(Deleted User) Subject: One file in, two files out
Author: (Deleted User)
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


   
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.