|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xml nodes with spaces (at start, end, or just spac
The most important thing to take away from my message is that the node defined here:
<Text>The quick<deleted> brownfox
</deleted><inserted> brown fox </inserted>jumped over
the fat lazy<inserted> </inserted>dog.</Text>
has one single child text node. When you escape the contents of the element you are telling the xml parser to treat the whole thing as text, which means that it does not get parsed into nodes so there are no inserted nodes, or deleted nodes, only the text.
I used Saxon to transform the xml/xsl that you sent and got this result:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>OSR report 1.1</title>
<LINK REL="stylesheet" HREF="reports/css/mxml.css" TYPE="text/css">
</head>
<body><font size="3" color="#000000">Learning
Point</font><hr>
<b>Text Chunk</b><br><font size="2" color="#FF0000"><b><Script src="re
ports/js/row.js"></Script></b></font><br><font size="2" color="#0000FF">Text Row
:</font><br>----- On Screen Text -----<br>
<br><br></body>
</html>
Which doesn't contain the output that you sent in your previous message. What processor are you using? Also, when sending examples you should try and trim it to the smallest running example that shows your problem.
Josh
-----Original Message-----
From: Andrew Madigan [mailto:Andrew_Madigan@xxxxxxxxxxxxx]
Sent: Thursday, June 17, 2004 3:19 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: xml nodes with spaces (at start, end, or just spaces)
not showing correctly with xsl
Hi Josh,
I keep getting failure notices, so I guess the file is too large so I
have striped out some of the xsl that does not deal with the same issue.
Here is a sample XML:
<?xml version="1.0" encoding="UTF-8"?>
<LearningObject version="6">
<LearningObjectProperties>
<FileName/>
<Duration/>
<ObjectType>Flash</ObjectType>
<LearningObjective>After completing this topic, you should be able
to </LearningObjective>
<LearningPathCode/>
<LearningPathTitle/>
<ModuleCode/>
<ModuleTitle/>
<LearningEventCode/>
<LearningEventTitle/>
<LearningObjectCode/>
<LearningObjectTitle/>
</LearningObjectProperties>
<LearningPoint type="conceptual" audioenabled="false">
<Title/>
<Slide type="textual">
<Click type="text">
<Text>The quick<deleted> brownfox
</deleted><inserted> brown fox </inserted>jumped over
the fat lazy<inserted> </inserted>dog.</Text>
</Click>
</Slide>
<ObjectId></ObjectId>
</LearningPoint>
</LearningObject>
And the striped down XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="LearningObject" >
<xsl:for-each select="LearningPoint">
<html>
<head>
<title>OSR report 1.1</title>
<LINK REL="stylesheet" HREF="reports/css/mxml.css"
TYPE="text/css"/>
</head><body>
<font size="3" color="#000000">Learning
Point</font><hr/>
<xsl:for-each select="Title[deleted]">
Title (Deletion):
<br/>
<xsl:apply-templates/>
</xsl:for-each>
<xsl:for-each select="Title[inserted]">
Title (Insertion):
<br/>
<xsl:apply-templates/>
</xsl:for-each>
<xsl:apply-templates/>
<br/>
<br/>
</body>
</html>
</xsl:for-each>
</xsl:template>
<xsl:template match="deleted"/>
<xsl:template match="b">
<b>
<xsl:apply-templates/>
</b>
</xsl:template>
<xsl:template match="p">
<p/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="inserted">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="br">
<br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="i">
<i>
<xsl:apply-templates/>
</i>
</xsl:template>
<xsl:template match="font[@face='Courier New, Courier, mono']">
<font face='Courier New, Courier, mono'>
<xsl:apply-templates/>
</font>
</xsl:template>
<xsl:template match="Reply"/>
<xsl:template match="Slide[@type='textual']">
<b>Text Chunk</b>
<xsl:for-each select="Click[@type='text']">
<br/><font size="2" color="#FF0000">
<b><Script src="reports/js/row.js"/>
</b></font>
<br/><font size="2" color="#0000FF">Text Row:</font>
<br/>----- On Screen Text -----<br/>
<xsl:for-each select="Text[deleted]">
Deletion:
<br/>
<xsl:apply-templates/>
</xsl:for-each>
<xsl:for-each select="Text[inserted]">
Insertion:
<br/>
<xsl:apply-templates/>
</xsl:for-each>
<xsl:for-each select="Launch[@type='animation']">
----- Animation -----<br/>
<xsl:for-each select="Prompt/Content[deleted]">
Prompt (Deletion):
<br/>
<xsl:apply-templates/>
</xsl:for-each>
<xsl:for-each select="Prompt/Content[inserted]">
Prompt (Insertion):
<br/>
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="Launch[@type='windowlaunch']">
----- Launch Window -----<br/>
<xsl:for-each select="Prompt/Content[deleted]">
Prompt (Deletion):
<br/>
<xsl:apply-templates/>
</xsl:for-each>
<xsl:for-each select="Prompt/Content[inserted]">
Prompt (Insertion):
<br/>
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="Code[deleted]">
<div id="alttext">
Code (Deletion):
<br/>
<xsl:apply-templates/>
</div>
</xsl:for-each>
<xsl:for-each select="Code[inserted]">
<div id="alttext">
Code (Insertion):
<br/>
<xsl:apply-templates/>
</div>
</xsl:for-each>
<xsl:for-each select="Syntax[deleted]">
<div id="alttext">
Syntax (Deletion):
<br/>
<xsl:apply-templates/>
</div>
</xsl:for-each>
<xsl:for-each select="Syntax[inserted]">
<div id="alttext">
Syntax (Insertion):
<br/>
<xsl:apply-templates/>
</div>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Thanks!
Andy
-----Original Message-----
From: Josh Canfield [mailto:Josh.Canfield@xxxxxxxxxxxx]
Sent: 16 June 2004 18:15
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: xml nodes with spaces (at start, end, or just spaces)
not showing correctly with xsl
You have escaped the text inside of your Text element so that the XML
parser will treat it like text, therefore there are no <inserted> or
<deleted> elements, only a block of text.
Why are you escaping the contents of the <Text> element?
Also, your output is not what I would expect. I would expect to see the
"<inserted>" make it into the output. Can you show a complete
template that outputs as you have described?
Josh
--+------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--+--
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








