[oXygen-user] XML refactoring including top PI

Radu Pisoi
Tue May 3 08:08:06 CDT 2016


Hi Pierre,

Yes, you are right. The nodes before and after the root element are not visible in the XSLT transformation involved by the XML refactoring process.

The reason for this limitation is that we don't want to load the associated DTD (DOCTYPE) to avoid the expansion of DTD entities. So, the XSLT transformation will receive only the root element without the nodes before or after it.

Unfortunately, there is no workaround for this issue. I will add an entry to our issue tracking system to extract only the DOCTYPE declaration from the initial document leaving the possibility to process the nodes before and after the root element.

Regards,
Radu
--
Radu Pisoi
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 5/3/2016 1:23 PM, Pierre Attar wrote:
> Hi,
> 
> In an RNG 1.3 DITA environment, and I try to use the Oxygen refactoring 
> tool to enable users to convert from one topic type to an other.
> 
> For example, I want to convert
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-model href="*iam.rng*" type="application/xml" 
> schematypens="http://relaxng.org/ns/structure/1.0" ?>
> *<iam* xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" 
> id="G19-3-5">
>     <title>19-3-5
> ...
> 
> To
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-model href="*patientsSous.rng*" type="application/xml" 
> schematypens="http://relaxng.org/ns/structure/1.0" ?>
> *<patientsSous* 
> xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="G19-3-5">
>     <title>19-3-5
> ...
> 
> I've no problem to transform XML elements using a refactoring XSLT 
> stylesheet but this does not affects the top front PI.
> 
> My stylesheet :
> 
> *At document level, I remove any previous PI*
>      <xsl:template match="/">
>          <xsl:apply-templates select="*"/>
>      </xsl:template>
> 
> *At top root element, I generate the new**PI before contents*
>      <xsl:template match="/*">
>          <xsl:processing-instruction name="xml-model"> 
> href="patientsSous.rng" type="application/xml" 
> schematypens="http://relaxng.org/ns/structure/1.0"</xsl:processing-instruction>
>          <patientsSous >
>              <xsl:apply-templates select="node() | @*"/>
>          </patientsSous>
>      </xsl:template>
> 
> 
> 
> So, it is likely if using the refactoring tool, the stylesheet is 
> applied only to root element, not the PI in front  of the root element.
> 
> Is it really the case ? A bug ? Anyone knows how to also modify the top 
> front PI ?
> 
> 
> Regards, Pierre
> 
> 
> 
> 
> _______________________________________________
> oXygen-user mailing list
> 
> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
> 


-- 
Regards,
Radu
--
Radu Pisoi
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


More information about the oXygen-user mailing list