[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Contained XML tag won't display

  • To: "James Rayner" <rcxau@y...>
  • Subject: RE: Contained XML tag won't display
  • From: "Ross Ken" <Ken.Ross@i...>
  • Date: Thu, 16 Jan 2003 07:34:33 +1000
  • Cc: <xml-dev@l...>
  • Importance: normal
  • Priority: normal
  • Thread-index: AcK8hGswQLyrRa5kTWiad/Wyg8G3ygAWWd3A
  • Thread-topic: Contained XML tag won't display

james rayner
Your template for f should look like below
 
<!-- <f /> -->
<xsl:template match="f">
<h5><font face="courier new" color="#d500ee">
<xsl:value-of select="@type" />&#160;<xsl:value-of select="@name" />&#160;(<xsl:value-of select="@param" />)&#160;</font>{
<br /><xsl:apply-templates /><br />}
</h5>
</xsl:template>
 
Without the apply templates it will never process the children nodes of f.  The only node that is processed by XSLT is the root node.  All other nodes it needs to be told (via apply-templates) to process.
 
HTH,

Ken Ross
Ph: +61 7 32359370
Mob: +61 (0)419 772299
Email: Ken.Ross@i...

-----Original Message-----
From: James Rayner [mailto:rcxau@y...]
Sent: Wednesday, 15 January 2003 8:55 PM
To: xml-dev@l...
Subject: Contained XML tag won't display

Hi
I have an xml tag but when i put another tag inside it, the contained tag does not display
It should display
 
Heading
int main () {
Assign to variable: string [hello]
}

but it instead displays:
 
Heading
int main () {
Assign to variable: 

}
 
The code is below
 
Thanks in advance
James Rayner
 
XML/XSL CODE
Code problem.xml
 
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="problem.xsl" type="text/xsl"?>
<cpp>
<name value="Heading"></name>
 
<f name="main" type="int" >
Assign to variable:
<!-- Tag below won't display -->
<v name="hello" type="string" />
 
</f>
</cpp>
 
Code problem.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="html" indent="yes" doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="
http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd" />
 
<xsl:template match="/">
<html>
<body><font face="courier new">
<p>
   <xsl:apply-templates select="//cpp" />
</p>
</font>
</body>
</html>
</xsl:template>

<!-- <name /> -->
<xsl:template match="name">
<h2>
<xsl:value-of select="@value" />
</h2>
</xsl:template>
 
<!-- <v /> -->
<xsl:template match="v">
<font face="courier new" color="red">
<h5><xsl:value-of select="@types" />[<xsl:value-of select="@names" />]</h5>
</font>
</xsl:template>
 
<!-- <f /> -->
<xsl:template match="f">
<h5><font face="courier new" color="#d500ee">
<xsl:value-of select="@type" />&#160;<xsl:value-of select="@name" />&#160;(<xsl:value-of select="@param" />)&#160;</font>{
<br /><xsl:value-of select="." /><br />}
</h5>
</xsl:template>
</xsl:stylesheet>
End Code
 
<about
   name="RCXAU"
   email="rcxau@y..."
   question="Why is the buggiest browser the most widespread" />
<VRtech
   motto="Bringing you all things IT (in the near future :-)"
   web="http://vr_tech.tripod.com/" />
IMPORTANT: This email (including any attachments) may contain confidential,
private or legally privileged information and may be protected by copyright. You may
only use it if you are the person(s) it was intended to be sent to and if you use it in an
authorised way. No one is allowed to use, review, alter, transmit, disclose, distribute,
print or copy this e-mail without appropriate authority.

If this e-mail was not intended for you and was sent to you by mistake, please
telephone or e-mail me immediately, destroy any hard copies of this e-mail and delete
it and any copies of it from your computer system. Any legal privilege and
confidentiality attached to this e-mail is not waived or destroyed by that mistake.

It is your responsibility to ensure that this e-mail does not contain and is not affected
by computer viruses, defects or interference by third parties or replication problems
(including incompatibility with your computer system).




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.