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

RE: Double output

Subject: RE: Double output
From: "Ross Ken" <Ken.Ross@xxxxxxxxxxxxxx>
Date: Mon, 10 Mar 2003 11:29:51 +1000
ken double
Try replacing
  <xsl:template match="SubSection">
    <h4><xsl:apply-templates/></h4>
    <p><xsl:apply-templates select="TextPara"/></p>
  </xsl:template>
With
  <xsl:template match="SubSection">
    <xsl:apply-templates/>
  </xsl:template>
Or
  <xsl:template match="SubSection">
    <h4><xsl:apply-templates select="ssHdr"/></h4>
    <p><xsl:apply-templates select="TextPara"/></p>
  </xsl:template>
Depending on whether the order of nodes in the XML document is controlled.


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


-----Original Message-----
From: Jack Cane [mailto:jwcane@xxxxxxxxxxx]
Sent: Monday, 10 March 2003 7:38 AM
To: aaxslList Post
Subject: FW:  Double output



(First message omitted the .xsl snippet)

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Jack Cane
Sent: Sunday, March 09, 2003 4:03 PM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Double output


I have the following definition in my .xsd:

  <xs:element name="SubSection">
    <xs:complexType>
	<xs:sequence>
	  <xs:element ref="ssHdr"/>
	  <xs:element ref="TextPara" maxOccurs="unbounded"/>
	</xs:sequence>
    </xs:complexType>
  </xs:element>

...the following in my .xsl:

  <xsl:template match="ssHdr">
  	<h4><xsl:apply-templates/></h4>
  </xsl:template>
  <xsl:template match="TextPara">
    <p><xsl:apply-templates/></p>
  </xsl:template>
  <xsl:template match="SubSection">
    <h4><xsl:apply-templates/></h4>
    <p><xsl:apply-templates select="TextPara"/></p>
  </xsl:template>

...and, finally, the following in my .xml:

  <xsl:template match="ssHdr">
  	<h4><xsl:apply-templates/></h4>
  </xsl:template>

  <ProbStmt>
    <SubSection>
      <ssHdr>Problem Statement</ssHdr>
      <TextPara>Some sample text here</TextPara>
    </SubSection>
  </ProbStmt>

When I open the xml file in MSIE 6.28, the subsection header, "Problem
Statement", is correctly rendered. However, the paragraph of text, "Some
sample text here", is printed twice, once as a subsection header, and again
as text within the subsection.

I think my logic is somehow wrong. I have an element subsection which
consists of a heading (ssHdr) and one or more elements TextPara.

I defined ssHdr separetly, as shown above. Maybe the ssHdr should not be
declared within the Subsection? But it seems appropriate to do so. I must be
missing something.

Would appreciate somehone showing me what is wrong here.

jwc



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

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).




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.