OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
formatting text...

I have an XML doc that in one of its fields can contain a list of
items...  for example

There is some text here.  Followed by a list:
   * item 1
   * item n
Now there may be some additional text here.

The portion of the XSLT that handles this block is 

<xsl:template name="DETAILS">
   <xsl:param name="FID"/>
         <b><SPAN STYLE="font-style:italic">Discussion:</SPAN></b>

Is there any way to make sure that each of the list items displays on
its own line and indented?  I've tried adding the hex characters (&#xD;
&#xA; &#x9;) to my XML doc, but when the page is rendered in the
browser it all renders as one line.

| José J. Cintrón

-----Original Message-----
From: Cintron, Jose J. 
Sent: Thursday, November 09, 2006 12:33
To: 'joe@rightway.co.uk'; xml-dev@lists.xml.org
Subject: RE: [xml-dev] XSLT call-template question

Thanks for the suggestion it worked great! 

| José J. Cintrón - <jcintron@mitre.org>
| MITRE Corporation
| 7515 Colshire Drive
| Mail Stop T330
| McLean, VA  22102-7508
| Phone: 703.983.3040
| Fax: 703.983.1397
-----Original Message-----
From: Joe Fawcett [mailto:joefawcett@hotmail.com] 
Sent: Thursday, November 09, 2006 12:24
To: xml-dev@lists.xml.org
Cc: Cintron, Jose J.
Subject: RE: [xml-dev] XSLT call-template question


You rarely need the match on a xsl:template to start with //. So you
<xsl:template match="//imp:FINDING[imp:FINDING_STATUS='O'"> to
(Not sure you need the predicate either but I don't know the whole
code) An
obsession with using //in XPath expressions seems all too common, not
why, perhaps there are a lot of poor examples online :) If you want the
<FINDING_ID> element in the <xsl:template name="FINDING_DETAILS"> then
could pass it in:
   <xsl:call-template name="FINDING_DETAILS">
    <xsl:with-param name="FID" select="imp:FINDING_ID"/>

  <xsl:template name="FINDING_DETAILS">
    <xsl:param name="FID"/>

>From: "Cintron, Jose J." <jcintron@mitre.org>
>To: <xml-dev@lists.xml.org>
>Subject: [xml-dev] XSLT call-template question
>Date: Thu, 9 Nov 2006 11:56:50 -0500
>I have an XML doc and XSLT that look that looks like the following 
>samples.  What I want to do is to pull the description of the 
>vulnerability from a separate document.  The problem is that when I 
>call the FINDING_DETAILS template for some reason I cannot access the 
>FINDING_ID of the FINDING that I'm currently processing.  I tried,
>to see what I got <xsl:variable name="FID"><xsl:value-of 
>select="self::*"/><xsl:value-of select="$FID"/> and what I got was the

>whole finding that I'm processing.  That said.  How the heck do I 
>select the FINDING_ID item so that I can assign that value to the 
>variable and then I use this to pull the correct description from the 
>external document.
>--- BEGIN XML ---
><?xml version="1.0" encoding="UTF-8"?>
><?xml-stylesheet type='text/xsl' href='DCID_Open.xslt'?> <IMPORT_FILE 
>    <FINDING>
>       <FINDING_ID>V0006670</FINDING_ID>
>       <VUL_NAME>Mechanism in place for key recovery</VUL_NAME>
>    </FINDING>
>    .
>    Repate this many, many times
>    .
>--- END XML ---
>--- BEGIN XSLT ---
><?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0"
><xsl:template match="/">
>    <HTML>
>    <HEAD>
>          <TITLE>Findings Report</TITLE>
>    </HEAD>
>    <BODY style="font-family: sans-serif">
>    <h3Findings:</h3>
>       <xsl:apply-templates
>          <xsl:sort select="imp:SEVERITY" order="ascending"
>data-type="number" />
>          <xsl:sort select="imp:FINDING_ID" order="ascending"
>data-type="text" />
>       </xsl:apply-templates>
>    </BODY>
>    </HTML>
><xsl:template match="//imp:FINDING[imp:FINDING_STATUS='O'">
>    <dl>
>       <table>
>          <tr>
>             <td>
>                <table>
>                   <tr>
>                      <td><xsl:apply-templates select="imp:SEVERITY"
>                      <td><xsl:apply-templates select="imp:FINDING_ID"
>/> </td>
>                   </tr>
>                   <tr>
>                      <td colspan="2"><xsl:apply-templates 
>select="imp:VUL_NAME" /></td>
>                   </tr>
>                </table>
>             </td>
>          </tr>
>          <tr><td><xsl:call-template name="FINDING_DETAILS"
>          <tr><td><xsl:apply-templates select="imp:SCRIPT_RESULTS"
>          <tr><td><xsl:call-template name="TEST" /></td></tr>
>       </table>
>    </dl>
><xsl:template name="FINDING_DETAILS">
>    <dd><b><SPAN STYLE="font-style:italic">Details:</SPAN></b></dd>
>    <dd>
>       <xsl:variable name="FID"><xsl:value-of 
>       <xsl:value-of
>    </dd>
>Just ignore the rest of the templates they work just fine...
>--- END XSLT ---
>| José J. Cintrón - <jcintron@mitre.org>
>| MITRE Corporation
>| 7515 Colshire Drive
>| Mail Stop T330
>| McLean, VA  22102-7508
>| Phone: 703.983.3040
>| Fax: 703.983.1397
>XML-DEV is a publicly archived, unmoderated list hosted by OASIS to 
>support XML implementation and development. To minimize spam in the 
>archives, you must subscribe before posting.
>[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
>Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
>subscribe: xml-dev-subscribe@lists.xml.org List archive: 
>List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS