 |
| XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 25th, 2009, 03:40 AM
|
|
Authorized User
|
|
Join Date: Feb 2009
Posts: 31
Thanks: 6
Thanked 1 Time in 1 Post
|
|
XSLT 2.0:
Hi,
This is my first post in this site. I hope that I'll get the answer asap.
I have the following input xml file and want to generate the output file according to 'Output:'.
Note: The '<REQUISITOS_DESC>' tag is only the standard tag and child tag can be anything in the input file.
Please help me this is very very important for me.
Thanks,
Anil
Input:
<REQUISITOS_DESC>
<DIV class="txtHd" id="_CshTitle" style="MARGIN-TOP: 10px; MARGIN-BOTTOM: 10px">Course Outline </DIV>
<DIV><P><B><SPAN>Achieving Business Growth through Strategic Input</SPAN></B></P>
<P><B><SPAN><OP/></SPAN></B> </P>
<P><SPAN>F&S is a world leader in research-based strategic consultancy, Strategy.<OP/></SPAN></P>
<P><I/></P>
<OP><I><FONT face="Arial" size="3"> </FONT></I></OP>
<P/>
<P><B><SPAN>Masterclass Objectives<OP/></SPAN></B>
</P>
<P><SPAN>This one day masterclass provides a unique opportunity for strategic decision makers case studies.<OP/></SPAN></P>
<P><I/></P>
<OP><I><FONT face="Arial" size="3"> </FONT></I></OP>
<P/>
<P><B><SPAN>Whom will the Masterclass benefit? <OP/></SPAN></B>
</P>
<P><SPAN>This is an opportunity for senior decision makers to share problems and solutions to contemporary level and above.<SPAN> </SPAN><OP/></SPAN></P>
<P><I/></P>
<OP><I><FONT face="Arial" size="3"> </FONT></I></OP>
<P/>
<P><B><SPAN>Course Duration<OP/></SPAN></B></P>
<P><SPAN>One day<OP/></SPAN></P>
<P/>
<OP><FONT face="Arial" size="3"> </FONT></OP>
<P/>
<P><B><SPAN>Masterclass Content<OP/></SPAN></B></P>
<UL>
<LI/><SPAN>Overview of contemporary business challenges<OP/></SPAN>
<LI/><SPAN>3-4 major case studies led by top strategic consultants form Frost & Sullivan<OP/></SPAN>
<LI/><SPAN>Facilitated discussions on how these approaches would apply in practice<OP/></SPAN>
</UL>
</DIV>
</REQUISITOS_DESC>
Output
<REQUISITOS_DESC>
Course Outline
Achieving Business Growth through Strategic Input
F&S is a world leader in research-based strategic consultancy, Strategy.
Masterclass Objectives
This one day masterclass provides a unique opportunity for strategic decision makers case studies.
Whom will the Masterclass benefit?
This is an opportunity for senior decision makers to share problems and solutions to contemporary level and above.
</REQUISITOS_DESC>
<REQUISITOS_DESC2>
Course Duration
One day
Masterclass Content
Overview of contemporary business challenges
3-4 major case studies led by top strategic consultants form Frost & Sullivan
Facilitated discussions on how these approaches would apply in practice
</REQUISITOS_DESC2>
|
|

March 25th, 2009, 03:56 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
Since it's important to you, let me make some suggestions:
(a) choose a subject heading that describes the problem.
(b) don't say that it's urgent or important or that you're in a hurry. Very often, people who say that don't take the time to phrase the question carefully or to study the answer, and this puts people off from responding.
(c) say what you tried and where you got stuck.
Your problem looks like a very simple one, and I've no idea where you are having difficulty with it. Don't expect people to write the code for you: we're here to help when you're stuck, not to provide a free programming service.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|
|

March 25th, 2009, 04:17 AM
|
|
Authorized User
|
|
Join Date: Feb 2009
Posts: 31
Thanks: 6
Thanked 1 Time in 1 Post
|
|
XSLT
Hi Michael,
Thanks for the suggestion/advise. I'll take care. Please find below the xslt code. I'm coming across the two main problems which are stucking me:
1. I'm not able to store the value in global variable 'AnilCount' as after exit from first for loop the variable 'AnilCount get empty and shows a warning "SXWN9001: A variable with no following sibling instructions has no effect"
2. With this code I get only the following text not their child text :
Achieving Business Growth through Strategic Input
Masterclass Objectives
Whom will the Masterclass benefit?
Please let me know if you need anything else regarding this. If you wish I can post you the complete XSLT file. Awaiting for your kind response.
Thanks,
Anil
XSLT Code:
Code:
<xsl:template match="REQUISITOS_DESC">
<REQUISITOS_DESC>
<xsl:for-each select="descendant::*">
<xsl:variable name="Anil" select="."/>
<xsl:if test=".=text()">
<xsl:if test="starts-with($Anil, 'Course') and contains($Anil, 'Course Duration')">
<xsl:text>Found @ Node:** </xsl:text><xsl:value-of select="position()"/>
<xsl:variable name="AnilCount" select="position()"/>
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="descendant-or-self::*">
<xsl:if test="position()<number($AnilCount)">
<xsl:if test=".=text()">
<xsl:apply-templates/><xsl:text>
</xsl:text>
</xsl:if>
<xsl:if test="not(.=text())">
</xsl:if>
</xsl:if>
</xsl:for-each>
</REQUISITOS_DESC>
</xsl:template>
|
|

March 25th, 2009, 05:28 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
OK. Trying to reverse-engineer your requirements from incorrect code isn't always easy, but it looks to me as if you're trying to output all the text, ignoring all markup, and starting a new element whenever you find the text "Course Description". Under certain conditions you're also outputting a newline - I'm not sure exactly when, but let's say it's after every non-empty text node.
That would suggest:
[code]
<xsl:for-each-group select="//text()[normalize-space()]"
group-starting-with="text()[starts-with(normalize-space(), 'Course Description')]">
<REQUISITOS_DESC>
<xsl:value-of select="current-group()" separator="'
'"/>
</REQUISITOS_DESC>
</xsl:for-each-group>
What this does is to select all the descendant text nodes that have some non-whitespace content, split them into groups with each group starting at a "Course Description", then to wrap each group in an element, and separate the nodes within each group with a newline.
You have tried to tackle this in a much too low-level, procedural way. XSLT requires a much more declarative way of thinking - describe the problem, not the detailed steps to solving it. In particular, you can't use variables the way you are used to from lower-level languages.
I would recommend doing more reading and less coding while you become familiar with the language. In particular, study lots of examples.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|
|

March 26th, 2009, 01:29 AM
|
|
Authorized User
|
|
Join Date: Feb 2009
Posts: 31
Thanks: 6
Thanked 1 Time in 1 Post
|
|
Apologies to not reply earlier.
But I want to do manipulations with <REQUISITOS_DESC> element only not the entire file. For this I have added a "." in the path expression 'select=".//text()[normalize-space()]"' with this expression it is working well in <REQUISITOS_DESC> but the nodes get merged whereas I require the text with line break.
The second problem is it stores both the groups in one tag whereas I want to store the second part in a different tag. Kindly suggest.
Current Output:
Course Outline Achieving Business Growth through Strategic Input F&S is a world leader in research-based strategic consultancy, Strategy.Masterclass Objectives
This one day masterclass provides a unique opportunity for strategic decision makers case studies.Whom will the Masterclass benefit?This is an opportunity for senior decision makers to share problems and solutions to contemporary level and above.
Output required:
Course Outline
Achieving Business Growth through Strategic Input
F&S is a world leader in research-based strategic consultancy, Strategy.
Masterclass Objectives
This one day masterclass provides a unique opportunity for strategic decision makers case studies.
Whom will the Masterclass benefit?
This is an opportunity for senior decision makers to share problems and solutions to contemporary level and above.
Kindly look into this and do the needful.
Best regards,
Anil
|
|

March 26th, 2009, 03:56 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
If you want help in debugging your code, it helps to show your code.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|
|

March 26th, 2009, 04:48 AM
|
|
Authorized User
|
|
Join Date: Feb 2009
Posts: 31
Thanks: 6
Thanked 1 Time in 1 Post
|
|
XSLT 2.0: Filtering and Spliting text
Hi Michael,
Please find below the code of XSLT and XML file:
XSLT
Code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table"
xmlns:xtbl="com.nwalsh.xalan.Table"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xlink doc stbl xtbl lxslt xs"
version='2.0'>
<xsl:strip-space elements="*"/>
<xsl:preserve-space elements="PROGRAMA2 P H1 BR"/>
<xsl:output method="xml"
indent="yes"
omit-xml-declaration="no"
encoding="UTF-8"/>
<!-- ========================================================================== -->
<!-- Capture FileName -->
<!-- ========================================================================== -->
<xsl:param name="name" as="xs:string" required="yes"/>
<xsl:variable name="file" select="$name"/>
<!-- ========================================================================== -->
<!-- Root Element -->
<!-- ========================================================================== -->
<xsl:template match="*|@*|node()|comment()">
<xsl:copy>
<xsl:apply-templates select="text()|*|@*|node()|comment()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="PRECIO">
<xsl:variable name="PRECIO" select="."/>
<PRECIO>
<xsl:if test="text()">
<xsl:value-of select="substring-after($PRECIO,':Ã ')"/>
</xsl:if>
<xsl:if test="not(text())">
<xsl:apply-templates/>
</xsl:if>
</PRECIO>
</xsl:template>
<xsl:template match="DURACION">
<xsl:variable name="DURACION" select="."/>
<DURACION>
<xsl:if test="contains($DURACION, ':')">
<xsl:value-of select="substring-before(substring-after($DURACION,': '), ' ')"/>
</xsl:if>
<xsl:if test="not(contains($DURACION, ':'))">
<xsl:apply-templates/>
</xsl:if>
</DURACION>
</xsl:template>
<xsl:template match="REQUISITOS_DESC">
<xsl:for-each-group select=".//text()[normalize-space()]" group-starting-with="text()[starts-with(normalize-space(), 'Course Duration')]">
<REQUISITOS_DESC>
<xsl:value-of select="current-group()" separator="'
'"/>
</REQUISITOS_DESC>
</xsl:for-each-group>
</xsl:template>
</xsl:stylesheet>
XML File:
Code:
<?xml version="1.0" encoding="windows-1252"?>
<CURSOS>
<CURSO>
<TITULO>Achieving Business Growth through Strategic Insight</TITULO>
<DESC_CORTA>This one day masterclass provides a unique opportunity for strategic decision makers to share their experiences with senior strategic consultants and peers in bringing about organisational growth and development through the use of business and competitive intelligence</DESC_CORTA>
<PRECIO>Price: £699 (First Delegate Rate) £630 (Additional Delegate Rate)</PRECIO>
<DURACION>Course Duration: 1 day(s)</DURACION>
<REQUISITOS_DESC>
<DIV class="txtHd" id="_CshTitle" style="MARGIN-TOP: 10px; MARGIN-BOTTOM: 10px">Course Outline </DIV>
<DIV>
<OP/>
<P>
<B>
<SPAN>Achieving Business Growth through Strategic Input</SPAN>
</B>
</P>
<P>
<B>
<SPAN>
<OP/>
</SPAN>
</B> </P>
<P>
<SPAN>F&S is a world leader in research-based strategic consultancy, particularly in technology based industries.<SPAN> </SPAN>We have developed peerless skills and knowledge in helping companies maximise the strategic value of their research investments through formulation and implementation of effective growth strategies.<SPAN> </SPAN>We plan to share some of this expertise in our exciting new one-day Masterclass From Intelligence to Strategy.<OP/>
</SPAN>
</P>
<P>
<I/>
</P>
<OP>
<I>
<FONT face="Arial" size="3"> </FONT>
</I>
</OP>
<P/>
<P>
<B>
<SPAN>Masterclass Objectives<OP/>
</SPAN>
</B>
</P>
<P>
<SPAN>This one day masterclass provides a unique opportunity for strategic decision makers to share their experiences with senior strategic consultants and peers in bringing about organisational growth and development through the use of business and competitive intelligence.<SPAN> </SPAN>The topics to be examined will vary from Masterclass to Masterclass, depending on the interests and challenges of participants.<SPAN> </SPAN>We will typically examine how the careful use of market knowledge and intelligence can provide strategic insights into such problems as divestment, acquisition, value based pricing, market entry, expansion, product development, technology innovation and even retrenchment.<SPAN> </SPAN>Sessions will be facilitated by an experienced consultant and will include in-depth analyses of real life, recent case studies. <OP/>
</SPAN>
</P>
<P>
<I/>
</P>
<OP>
<I>
<FONT face="Arial" size="3"> </FONT>
</I>
</OP>
<P/>
<P>
<B>
<SPAN>Whom will the Masterclass benefit? <OP/>
</SPAN>
</B>
</P>
<P>
<SPAN>This is an opportunity for senior decision makers to share problems and solutions to contemporary business problems with peers and experts.<SPAN> </SPAN>For this reason, participation will be strictly limited to top managers in strategic business unit level and above.<SPAN> </SPAN>
<OP/>
</SPAN>
</P>
<P>
<I/>
</P>
<OP>
<I>
<FONT face="Arial" size="3"> </FONT>
</I>
</OP>
<P/>
<P>
<B>
<SPAN>Course Duration<OP/>
</SPAN>
</B>
</P>
<P>
<SPAN>One day<OP/>
</SPAN>
</P>
<P/>
<OP>
<FONT face="Arial" size="3"> </FONT>
</OP>
<P/>
<P>
<B>
<SPAN>Masterclass Content<OP/>
</SPAN>
</B>
</P>
<UL>
<LI/>
<SPAN>Overview of contemporary business challenges<OP/>
</SPAN>
<LI/>
<SPAN>3-4 major case studies led by top strategic consultants form Frost & Sullivan<OP/>
</SPAN>
<LI/>
<SPAN>Facilitated discussions on how these approaches would apply in practice<OP/>
</SPAN>
</UL>
<P/>
<OP>
<FONT face="Arial" size="3"> </FONT>
</OP>
<B>
<SPAN>Typical Agenda<OP/>
</SPAN>
</B>
<P/>
<UL>
<LI/>
<SPAN>Contemporary business challenges and their strategic impact<OP/>
</SPAN>
<LI/>
<SPAN>3-4 In-depth Case Studies<OP/>
</SPAN>
</UL>
<P>
<SPAN>- Description of strategic business issue to be resolved<OP/>
</SPAN>
</P>
<P>
<SPAN>- Brief methodology<OP/>
</SPAN>
</P>
<P>
<SPAN>- Analysis of research results and construction of strategic options for business </SPAN>
<SPAN>growth<OP/>
</SPAN>
</P>
<P>
<SPAN>- Criteria for option selection<OP/>
</SPAN>
</P>
<P>
<SPAN>- What happened next?<OP/>
</SPAN>
</P>
<P>
<SPAN>- Implications for delegates’ companies<OP/>
</SPAN>
</P>
<UL>
<LI/>
<SPAN>Review and conclusions from the day.<OP/>
</SPAN>
</UL>
<P> </P>
<P/>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2">
<STRONG> </STRONG>
</FONT>
</OP>
<STRONG>To print or download this outline, please click on the icon below:</STRONG>
<P/>
<P/>
<P> </P>
<P/>
<OP>
<TABLE id="EDP_AREF_ms__id11" style="MARGIN-BOTTOM: 10px; MARGIN-RIGHT: 10px" align="left">
<CAPTION id="EDP_AREF_ms__id14" align="bottom">PL2539 - Achieving Buisness Growth through Strategic Insight.pdf</CAPTION>
<TBODY>
<TR id="EDP_AREF_ms__id15">
<TD id="EDP_AREF_ms__id13" align="middle">
<A>
<IMG/>
</A>
</TD>
</TR>
</TBODY>
</TABLE> </OP>
<P/>
<P/>
<P/>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2">
<STRONG> </STRONG>
</FONT>
</OP>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2">
<STRONG> </STRONG>
</FONT>
</OP>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2">
<STRONG> </STRONG>
</FONT>
</OP>
<P/>
<P/>
<P/>
<P>
<B style="mso-bidi-font-weight: normal"/>
</P>
<OP>
<B style="mso-bidi-font-weight: normal">
<FONT face="Arial" size="2"> </FONT>
</B>
</OP>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2"> </FONT>
</OP>
<P/>
<P/>
<P/>
</DIV>
</REQUISITOS_DESC>
<PUBLICO_OBJ/>
<PROGRAMA2/>
<INSTALACIONES>
<B>Jul 13 2009</B> | London</INSTALACIONES>
</CURSO>
</CURSOS>
Best regards,
Anil
|
|

March 26th, 2009, 05:14 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
That code looks OK as far as I can tell without seeing the source document. Please supply a cut-down source document that illustrates the problem, and show the actual output and how it differs from the desired output.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|
|

March 26th, 2009, 05:24 AM
|
|
Authorized User
|
|
Join Date: Feb 2009
Posts: 31
Thanks: 6
Thanked 1 Time in 1 Post
|
|
Conte
Please find the XML document:
Please take care about the Note I have given in first post.
Code:
<?xml version="1.0" encoding="windows-1252"?>
<CURSOS>
<CURSO>
<TITULO>Achieving Business Growth through Strategic Insight</TITULO>
<DESC_CORTA>This one day masterclass provides a unique opportunity for strategic decision makers to share their experiences with senior strategic consultants and peers in bringing about organisational growth and development through the use of business and competitive intelligence</DESC_CORTA>
<PRECIO>Price: £699 (First Delegate Rate) £630 (Additional Delegate Rate)</PRECIO>
<DURACION>Course Duration: 1 day(s)</DURACION>
<REQUISITOS_DESC>
<DIV class="txtHd" id="_CshTitle" style="MARGIN-TOP: 10px; MARGIN-BOTTOM: 10px">Course Outline </DIV>
<DIV>
<OP/>
<P>
<B>
<SPAN>Achieving Business Growth through Strategic Input</SPAN>
</B>
</P>
<P>
<B>
<SPAN>
<OP/>
</SPAN>
</B> </P>
<P>
<SPAN>F&S is a world leader in research-based strategic consultancy, particularly in technology based industries.<SPAN> </SPAN>We have developed peerless skills and knowledge in helping companies maximise the strategic value of their research investments through formulation and implementation of effective growth strategies.<SPAN> </SPAN>We plan to share some of this expertise in our exciting new one-day Masterclass From Intelligence to Strategy.<OP/>
</SPAN>
</P>
<P>
<I/>
</P>
<OP>
<I>
<FONT face="Arial" size="3"> </FONT>
</I>
</OP>
<P/>
<P>
<B>
<SPAN>Masterclass Objectives<OP/>
</SPAN>
</B>
</P>
<P>
<SPAN>This one day masterclass provides a unique opportunity for strategic decision makers to share their experiences with senior strategic consultants and peers in bringing about organisational growth and development through the use of business and competitive intelligence.<SPAN> </SPAN>The topics to be examined will vary from Masterclass to Masterclass, depending on the interests and challenges of participants.<SPAN> </SPAN>We will typically examine how the careful use of market knowledge and intelligence can provide strategic insights into such problems as divestment, acquisition, value based pricing, market entry, expansion, product development, technology innovation and even retrenchment.<SPAN> </SPAN>Sessions will be facilitated by an experienced consultant and will include in-depth analyses of real life, recent case studies. <OP/>
</SPAN>
</P>
<P>
<I/>
</P>
<OP>
<I>
<FONT face="Arial" size="3"> </FONT>
</I>
</OP>
<P/>
<P>
<B>
<SPAN>Whom will the Masterclass benefit? <OP/>
</SPAN>
</B>
</P>
<P>
<SPAN>This is an opportunity for senior decision makers to share problems and solutions to contemporary business problems with peers and experts.<SPAN> </SPAN>For this reason, participation will be strictly limited to top managers in strategic business unit level and above.<SPAN> </SPAN>
<OP/>
</SPAN>
</P>
<P>
<I/>
</P>
<OP>
<I>
<FONT face="Arial" size="3"> </FONT>
</I>
</OP>
<P/>
<P>
<B>
<SPAN>Course Duration<OP/>
</SPAN>
</B>
</P>
<P>
<SPAN>One day<OP/>
</SPAN>
</P>
<P/>
<OP>
<FONT face="Arial" size="3"> </FONT>
</OP>
<P/>
<P>
<B>
<SPAN>Masterclass Content<OP/>
</SPAN>
</B>
</P>
<UL>
<LI/>
<SPAN>Overview of contemporary business challenges<OP/>
</SPAN>
<LI/>
<SPAN>3-4 major case studies led by top strategic consultants form Frost & Sullivan<OP/>
</SPAN>
<LI/>
<SPAN>Facilitated discussions on how these approaches would apply in practice<OP/>
</SPAN>
</UL>
<P/>
<OP>
<FONT face="Arial" size="3"> </FONT>
</OP>
<B>
<SPAN>Typical Agenda<OP/>
</SPAN>
</B>
<P/>
<UL>
<LI/>
<SPAN>Contemporary business challenges and their strategic impact<OP/>
</SPAN>
<LI/>
<SPAN>3-4 In-depth Case Studies<OP/>
</SPAN>
</UL>
<P>
<SPAN>- Description of strategic business issue to be resolved<OP/>
</SPAN>
</P>
<P>
<SPAN>- Brief methodology<OP/>
</SPAN>
</P>
<P>
<SPAN>- Analysis of research results and construction of strategic options for business </SPAN>
<SPAN>growth<OP/>
</SPAN>
</P>
<P>
<SPAN>- Criteria for option selection<OP/>
</SPAN>
</P>
<P>
<SPAN>- What happened next?<OP/>
</SPAN>
</P>
<P>
<SPAN>- Implications for delegatesâ companies<OP/>
</SPAN>
</P>
<UL>
<LI/>
<SPAN>Review and conclusions from the day.<OP/>
</SPAN>
</UL>
<P> </P>
<P/>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2">
<STRONG> </STRONG>
</FONT>
</OP>
<STRONG>To print or download this outline, please click on the icon below:</STRONG>
<P/>
<P/>
<P> </P>
<P/>
<OP>
<TABLE id="EDP_AREF_ms__id11" style="MARGIN-BOTTOM: 10px; MARGIN-RIGHT: 10px" align="left">
<CAPTION id="EDP_AREF_ms__id14" align="bottom">PL2539 - Achieving Buisness Growth through Strategic Insight.pdf</CAPTION>
<TBODY>
<TR id="EDP_AREF_ms__id15">
<TD id="EDP_AREF_ms__id13" align="middle">
<A>
<IMG/>
</A>
</TD>
</TR>
</TBODY>
</TABLE> </OP>
<P/>
<P/>
<P/>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2">
<STRONG> </STRONG>
</FONT>
</OP>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2">
<STRONG> </STRONG>
</FONT>
</OP>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2">
<STRONG> </STRONG>
</FONT>
</OP>
<P/>
<P/>
<P/>
<P>
<B style="mso-bidi-font-weight: normal"/>
</P>
<OP>
<B style="mso-bidi-font-weight: normal">
<FONT face="Arial" size="2"> </FONT>
</B>
</OP>
<P/>
<P/>
<OP>
<FONT face="Arial" size="2"> </FONT>
</OP>
<P/>
<P/>
<P/>
</DIV>
</REQUISITOS_DESC>
<PUBLICO_OBJ/>
<PROGRAMA2/>
<INSTALACIONES>
<B>Jul 13 2009</B> | London</INSTALACIONES>
</CURSO>
</CURSOS>
Best regards,
Anil
|
|

March 26th, 2009, 05:56 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
I overlooked a rule in the XSLT spec that adjacent text nodes are merged without adding the separator. So change the relevant line to
<xsl:value-of select="current-group()/string()" separator="
"/>
Converting each text node to a string bypasses this rule and means the newline separators are inserted.
I had to make a few changes to your code such as escaping the & characters, but I expect those errors were introduced as a result of email transmission.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|
|
 |