[oXygen-user] copy of processing instructions

Ulrike Borinski Borinski at ifv-nrw.de
Fri May 24 00:28:59 CDT 2013


Dear George,

I found an answer: I changed the Transformation Scenario from type XML to type XSLT - and now the result has both: the deep copy and the transformed attribute.
What exactly is the difference? Could you please give me some Information?

example XML:
<Textebene-1>
       <Überschrift>Das erste Kapitel</Überschrift>
       <Sinneinheit>
           <Absatz>Ein beispielhafter Absatz …</Absatz>
           <Definition>
               <Absatz>Eine beispielhafte Definition …</Absatz>
           </Definition>
           <Absatz>Ein beispielhafter Absatz …</Absatz>
       </Sinneinheit>
   </Textebene-1>

The example XSLT is below.

Result:
<Textebene-1>
       <Überschrift Referenz="ü-1_Das-erste-Kapitel_000001">Das erste Kapitel</Überschrift>
       <Sinneinheit>
           <Absatz>Ein beispielhafter Absatz …</Absatz>
           <Definition Referenz="Def-001_000001">
               <Absatz>Eine beispielhafte Definition …</Absatz>
           </Definition>
           <Absatz>Ein beispielhafter Absatz …</Absatz>
       </Sinneinheit>
   </Textebene-1>

Best regards
Ulrike

Am 23.05.2013 um 11:20 schrieb George Cristian Bina:

> Dear Ulrike,
> 
> In order to be able to help you please provide a very small example XML and XSLT that show a sample input, the templates you use and then let us know what you should expect as output.
> 
> Best Regards,
> George
> --
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
> 
> On 5/23/13 10:38 AM, Ulrike Borinski wrote:
>> Thank you very much - you and Syd,
>> 
>> I would like to generate an attribute with value on this way. I tried to combine your coding with something like this:
>> 
>> <xsl:template match="Definition">
>>        <xsl:copy>
>>            <xsl:attribute name="Referenz">
>>                <xsl:text>Def-</xsl:text>
>>                <xsl:number count="Definition" level="any" format="001"/>
>>                <xsl:text>_</xsl:text>
>>                <xsl:value-of select="//Content-ID"/>
>>            </xsl:attribute>
>>            <xsl:apply-templates select="@* | node()"/>
>>        </xsl:copy>
>>    </xsl:template>
>> 
>> the copy is OK (deep), but nothing else happens
>> 
>> Regards,
>> Ulrike Borinski
>> 
>> 
>> Am 22.05.2013 um 15:15 schrieb Oxygen XML Editor Support:
>> 
>>> Hi,
>>> 
>>> You can use a deep copy stylesheet that also considers the processing instructions.
>>> 
>>> This is a modified version of the sample copy stylesheet from the Oxygen samples (Oxygen/samples/xhtml/copy.xsl):
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>>    <xsl:output method="xml"/>
>>>    <!-- Match document -->
>>>    <xsl:template match="/">
>>>        <xsl:apply-templates mode="copy" select="."/>
>>>    </xsl:template>
>>>    <!-- Deep copy template -->
>>>    <xsl:template match="*|text()|@*|processing-instruction()" mode="copy">
>>>        <xsl:copy>
>>>            <xsl:apply-templates mode="copy" select="@*"/>
>>>            <xsl:apply-templates mode="copy"/>
>>>        </xsl:copy>
>>>    </xsl:template>
>>>    <!-- Handle default matching -->
>>>    <xsl:template match="*"/>
>>> </xsl:stylesheet>
>>> 
>>> The only change I made was to the deep copy template. I've added: processing-instruction()
>>>    <xsl:template match="*|text()|@*|processing-instruction()" mode="copy">
>>> 
>>> Regards,
>>> Adrian
>>> 
>>> 
>>> On 22.05.2013 13:17, Ulrike Borinski wrote:
>>>> Hello,
>>>> 
>>>> I want to transform some XML-Documents containing some Track Changes Markup, <?oxy_delete?> for example. I need a deep copy of the document.
>>>> How can I preserve these PIs during a XSLT-Transformation?
>>>> 
>>>> Thank you
>>>> Ulrike Borinski
>>>> 
>>>> 
>>>> 
>>>> 
>>>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>>> Ulrike Borinski
>>>> Dipl.-Designerin
>>>> 
>>>> Koordination
>>>> Servicestelle Mediengestaltung und Publishing
>>>> 
>>>> Borinski at ifv-nrw.de
>>>> 
>>>> 02331/9330-927
>>>> 
>>>> 
>>>> www.ifv-nrw.de/ifv_gest/lerneinheiten.htm
>>>> 
>>>> 
>>>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>>> Institut für Verbundstudien der Fachhochschulen Nordrhein-Westfalens - IfV NRW
>>>> Im Alten Holz 131
>>>> 58093 Hagen
>>>> 
>>>> _______________________________________________
>>>> oXygen-user mailing list
>>>> 
>>>> oXygen-user at oxygenxml.com
>>>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>>> 
>>>> 
>>>> 
>>> 
>>> --
>>> Adrian Buza
>>> oXygen XML Editor and Author Support
>>> 
>>> Tel: +1-650-352-1250 ext.202
>>> Fax: +40-251-461482
>>> 
>>> support at oxygenxml.com
>>> http://www.oxygenxml.com
>> 
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> Ulrike Borinski
>> Dipl.-Designerin
>> 
>> Koordination
>> Servicestelle Mediengestaltung und Publishing
>> Borinski at ifv-nrw.de
>> 02331/9330-927
>> 
>> www.ifv-nrw.de/ifv_gest/lerneinheiten.htm
>> 
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> Institut für Verbundstudien der Fachhochschulen Nordrhein-Westfalens - IfV NRW
>> Im Alten Holz 131
>> 58093 Hagen
>> 
>> _______________________________________________
>> oXygen-user mailing list
>> oXygen-user at oxygenxml.com
>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>> 

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
Ulrike Borinski
Dipl.-Designerin

Koordination
Servicestelle Mediengestaltung und Publishing
Borinski at ifv-nrw.de
02331/9330-927

www.ifv-nrw.de/ifv_gest/lerneinheiten.htm

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
Institut für Verbundstudien der Fachhochschulen Nordrhein-Westfalens - IfV NRW
Im Alten Holz 131
58093 Hagen
Am 23.05.2013 um 11:20 schrieb George Cristian Bina:

> Dear Ulrike,
> 
> In order to be able to help you please provide a very small example XML and XSLT that show a sample input, the templates you use and then let us know what you should expect as output.
> 
> Best Regards,
> George
> --
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
> 
> On 5/23/13 10:38 AM, Ulrike Borinski wrote:
>> Thank you very much - you and Syd,
>> 
>> I would like to generate an attribute with value on this way. I tried to combine your coding with something like this:
>> 
>> <xsl:template match="Definition">
>>         <xsl:copy>
>>             <xsl:attribute name="Referenz">
>>                 <xsl:text>Def-</xsl:text>
>>                 <xsl:number count="Definition" level="any" format="001"/>
>>                 <xsl:text>_</xsl:text>
>>                 <xsl:value-of select="//Content-ID"/>
>>             </xsl:attribute>
>>             <xsl:apply-templates select="@* | node()"/>
>>         </xsl:copy>
>>     </xsl:template>
>> 
>> the copy is OK (deep), but nothing else happens
>> 
>> Regards,
>> Ulrike Borinski
>> 
>> 
>> Am 22.05.2013 um 15:15 schrieb Oxygen XML Editor Support:
>> 
>>> Hi,
>>> 
>>> You can use a deep copy stylesheet that also considers the processing instructions.
>>> 
>>> This is a modified version of the sample copy stylesheet from the Oxygen samples (Oxygen/samples/xhtml/copy.xsl):
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>>     <xsl:output method="xml"/>
>>>     <!-- Match document -->
>>>     <xsl:template match="/">
>>>         <xsl:apply-templates mode="copy" select="."/>
>>>     </xsl:template>
>>>     <!-- Deep copy template -->
>>>     <xsl:template match="*|text()|@*|processing-instruction()" mode="copy">
>>>         <xsl:copy>
>>>             <xsl:apply-templates mode="copy" select="@*"/>
>>>             <xsl:apply-templates mode="copy"/>
>>>         </xsl:copy>
>>>     </xsl:template>
>>>     <!-- Handle default matching -->
>>>     <xsl:template match="*"/>
>>> </xsl:stylesheet>
>>> 
>>> The only change I made was to the deep copy template. I've added: processing-instruction()
>>>     <xsl:template match="*|text()|@*|processing-instruction()" mode="copy">
>>> 
>>> Regards,
>>> Adrian
>>> 
>>> 
>>> On 22.05.2013 13:17, Ulrike Borinski wrote:
>>>> Hello,
>>>> 
>>>> I want to transform some XML-Documents containing some Track Changes Markup, <?oxy_delete?> for example. I need a deep copy of the document.
>>>> How can I preserve these PIs during a XSLT-Transformation?
>>>> 
>>>> Thank you
>>>> Ulrike Borinski
>>>> 
>>>> 
>>>> 
>>>> 
>>>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>>> Ulrike Borinski
>>>> Dipl.-Designerin
>>>> 
>>>> Koordination
>>>> Servicestelle Mediengestaltung und Publishing
>>>> 
>>>> Borinski at ifv-nrw.de
>>>> 
>>>> 02331/9330-927
>>>> 
>>>> 
>>>> www.ifv-nrw.de/ifv_gest/lerneinheiten.htm
>>>> 
>>>> 
>>>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>>>> Institut für Verbundstudien der Fachhochschulen Nordrhein-Westfalens - IfV NRW
>>>> Im Alten Holz 131
>>>> 58093 Hagen
>>>> 
>>>> _______________________________________________
>>>> oXygen-user mailing list
>>>> 
>>>> oXygen-user at oxygenxml.com
>>>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>>> 
>>>> 
>>>> 
>>> 
>>> --
>>> Adrian Buza
>>> oXygen XML Editor and Author Support
>>> 
>>> Tel: +1-650-352-1250 ext.202
>>> Fax: +40-251-461482
>>> 
>>> support at oxygenxml.com
>>> http://www.oxygenxml.com
>> 
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> Ulrike Borinski
>> Dipl.-Designerin
>> 
>> Koordination
>> Servicestelle Mediengestaltung und Publishing
>> Borinski at ifv-nrw.de
>> 02331/9330-927
>> 
>> www.ifv-nrw.de/ifv_gest/lerneinheiten.htm
>> 
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>> Institut für Verbundstudien der Fachhochschulen Nordrhein-Westfalens - IfV NRW
>> Im Alten Holz 131
>> 58093 Hagen
>> 
>> _______________________________________________
>> oXygen-user mailing list
>> oXygen-user at oxygenxml.com
>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>> 

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
Ulrike Borinski
Dipl.-Designerin

Koordination
Servicestelle Mediengestaltung und Publishing
Borinski at ifv-nrw.de
02331/9330-927

www.ifv-nrw.de/ifv_gest/lerneinheiten.htm

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
Institut für Verbundstudien der Fachhochschulen Nordrhein-Westfalens - IfV NRW
Im Alten Holz 131
58093 Hagen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20130524/dafd0fd5/attachment-0001.html 


More information about the oXygen-user mailing list