Hi,
 
I must process a DTD I did not write, where tags can include PCDATA and other embedded tags.
 
For example:
 
<!ELEMENT MAIN (#PCDATA,SUB)* />
<!ELEMENT SUB (#PCDATA) />
 
Then  a document may look like:
 
<MAIN>
    Text 1 here
    <SUB>embedded text</SUB>
    Text 2 here
</MAIN>
 
My problem is to output the whole text in the right order !
 
What "select" _expression_ could I use to get the following result ?
 
Text 1 here
<b>embedded text</b>
Text 2 here
 
First try:
 
<xsl:template match="MAIN">
    <xsl:apply-templates name="PROCESS" select="."/>
    <xsl:apply-templates name="PROCESS" select="SUB"/>
</xsl:template>
 
<xsl:template match="PROCESS">
    <xsl:value-of select="."/>
</xsl:template>
 
It gives (and it seems normal):
 
Text 1 here
Text 2 here
embedded text
 
(wrong reordering)
 
Second try:
 
<xsl:template match="MAIN">
    <xsl:apply-templates name="PROCESS" select=".|SUB"/>
</xsl:template>
 
<xsl:template match="PROCESS">
    <xsl:value-of select="."/>
</xsl:template>
 
Produces a "segmentation fault" of Xalan processor !
 
Any suggestion ?
 
Thanks,
 
Jerome
 
 
 
 
 

Reply via email to