Click here to Skip to main content
15,914,416 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralI'm lazy - How to do it without learning XSLT :) Pin
Cristoff22-Jan-04 0:48
Cristoff22-Jan-04 0:48 
GeneralRe: I'm lazy - How to do it without learning XSLT :) Pin
Not Active22-Jan-04 10:57
mentorNot Active22-Jan-04 10:57 
GeneralRe: I'm lazy - How to do it without learning XSLT :) Pin
Cristoff23-Jan-04 0:37
Cristoff23-Jan-04 0:37 
GeneralRe: I'm lazy - How to do it without learning XSLT :) Pin
Matthew Hazlett28-Jan-04 8:24
Matthew Hazlett28-Jan-04 8:24 
GeneralRe: I'm lazy - How to do it without learning XSLT :) Pin
Cristoff29-Jan-04 6:55
Cristoff29-Jan-04 6:55 
GeneralRe: I'm lazy - How to do it without learning XSLT :) Pin
Matthew Hazlett29-Jan-04 9:44
Matthew Hazlett29-Jan-04 9:44 
GeneralXSLT - Adding whitespace to a string Pin
cheezdog20-Jan-04 17:08
cheezdog20-Jan-04 17:08 
GeneralRe: XSLT - Adding whitespace to a string Pin
Philip Fitzsimons21-Jan-04 3:19
Philip Fitzsimons21-Jan-04 3:19 
not easy to do in xslt - here is the "pure" way (you could just embed some c# code in the xslt)

xml source document:
<br />
<document><br />
   <abc>1234</abc><br />
   <abc>234234</abc><br />
   <abc>21321</abc><br />
   <abc>91243149384</abc><br />
</document><br />



xslt document:
<br />
<?xml version="1.0" encoding="UTF-8" ?><br />
<xsl:stylesheet <br />
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"<br />
   version="1.0"><br />
   <br />
    <xsl:output method="xml" <br />
         media-type="text/xml" <br />
         indent="yes"<br />
         encoding="UTF-8"/><br />
   <br />
   <xsl:template name="document"><br />
      <xsl:apply-templates select="abc" /><br />
   </xsl:template><br />
   <br />
   <xsl:template name="abc"><br />
      <xsl:call-template name="padstring"><br />
         <xsl:with-param name="times" select="10 - string-length(text())" /><br />
         <xsl:with-param name="string"><xsl:value-of select="text()" /></xsl:with-param><br />
      </xsl:call-template>                  <br />
   </xsl:template><br />
<br />
   <xsl:template name="padstring"><br />
      <xsl:param name="current">1</xsl:param><br />
      <xsl:param name="times" /><br />
      <xsl:param name="string" /><br />
      <xsl:param name="paddingchar">&#32;</xsl:param><br />
      <br />
      <xsl:if test="$times &gt; 0)><br />
         <xsl:value-of select="$paddingchar" /><br />
      </xsl:if><br />
      <br />
      <xsl:if test="not($times &lt; $current) and $current != $times"><br />
         <xsl:call-template name="padstring"><br />
            <xsl:with-param name="current" select="$current + 1" /><br />
            <xsl:with-param name="times" select="$times" /><br />
            <xsl:with-param name="string" select="$string" /><br />
            <xsl:with-param name="paddingchar" select="$paddingchar" /><br />
         </xsl:call-template><br />
      </xsl:if><br />
   </xsl:template><br />
<br />
</xsl:stylesheet><br />


should work...




"When the only tool you have is a hammer, a sore thumb you will have."

GeneralDynamic Link Creation in ASP.Net Page /XSL Pin
laker_6616-Jan-04 7:27
laker_6616-Jan-04 7:27 
GeneralRe: Dynamic Link Creation in ASP.Net Page /XSL Pin
Not Active19-Jan-04 0:53
mentorNot Active19-Jan-04 0:53 
GeneralRe: Dynamic Link Creation in ASP.Net Page /XSL Pin
laker_6619-Jan-04 6:25
laker_6619-Jan-04 6:25 
GeneralRe: Dynamic Link Creation in ASP.Net Page /XSL Pin
Not Active19-Jan-04 10:12
mentorNot Active19-Jan-04 10:12 
GeneralRe: Dynamic Link Creation in ASP.Net Page /XSL Pin
Matthew Hazlett28-Jan-04 8:32
Matthew Hazlett28-Jan-04 8:32 
QuestionHow to fill the fields of IE's web page from within VB or C++ ? Pin
John Thomas15-Jan-04 6:13
John Thomas15-Jan-04 6:13 
AnswerRe: How to fill the fields of IE's web page from within VB or C++ ? Pin
Anonymous8-Feb-04 19:19
Anonymous8-Feb-04 19:19 
GeneralXSLT for converting an XML document to Text file Pin
cheezdog14-Jan-04 22:38
cheezdog14-Jan-04 22:38 
GeneralRe: XSLT for converting an XML document to Text file Pin
Philip Fitzsimons15-Jan-04 2:48
Philip Fitzsimons15-Jan-04 2:48 
GeneralHTTP Get-Post and XML Pin
Monty29-Jan-04 0:52
Monty29-Jan-04 0:52 
GeneralRe: HTTP Get-Post and XML Pin
Not Active13-Jan-04 3:42
mentorNot Active13-Jan-04 3:42 
GeneralRe: HTTP Get-Post and XML Pin
laker_6619-Jan-04 9:57
laker_6619-Jan-04 9:57 
GeneralJSP and Tomcat Pin
The_Server9-Jan-04 0:24
The_Server9-Jan-04 0:24 
GeneralRe: JSP and Tomcat Pin
ZoogieZork9-Jan-04 2:06
ZoogieZork9-Jan-04 2:06 
GeneralRe: JSP and Tomcat Pin
The_Server9-Jan-04 2:18
The_Server9-Jan-04 2:18 
GeneralRe: JSP and Tomcat Pin
ZoogieZork9-Jan-04 17:28
ZoogieZork9-Jan-04 17:28 
GeneralRe: JSP and Tomcat Pin
The_Server10-Jan-04 21:46
The_Server10-Jan-04 21:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.