Click here to Skip to main content
14,335,244 members
   

XML / XSL

 
Questionsaving a file to the internet. Pin
felixjrz198531-May-17 21:54
memberfelixjrz198531-May-17 21:54 
SuggestionRe: saving a file to the internet. Pin
Richard MacCutchan31-May-17 22:32
protectorRichard MacCutchan31-May-17 22:32 
GeneralRe: saving a file to the internet. Pin
felixjrz19851-Jun-17 0:43
memberfelixjrz19851-Jun-17 0:43 
GeneralRe: saving a file to the internet. Pin
Richard MacCutchan1-Jun-17 1:03
protectorRichard MacCutchan1-Jun-17 1:03 
GeneralRe: saving a file to the internet. Pin
Gerry Schmitz1-Jun-17 3:20
mveGerry Schmitz1-Jun-17 3:20 
AnswerRe: saving a file to the internet. Pin
Terry Perez11-Sep-17 3:41
memberTerry Perez11-Sep-17 3:41 
QuestionXSLT passing a variable to starts-with Pin
bjmallon13-Feb-17 14:03
memberbjmallon13-Feb-17 14:03 
AnswerRe: XSLT passing a variable to starts-with Pin
Richard Deeming14-Feb-17 2:32
mveRichard Deeming14-Feb-17 2:32 
Are you absolutely certain that the character parameter is getting the correct string value?

I've just tried the following simplified example, and it works as expected:
<?xml version="1.0"?>
<bookstore>
    <book>
         <title>The Weather Pattern</title>
         <author>Weather Man</author>
         <price>100.00</price>
    </book>
    <book>
         <title>Weaving Patterns</title>
         <author>Weaver</author>
         <price>150.00</price>
    </book>
    <book>
         <title>Speech Pattern</title>
         <author>Speaker</author>
         <price>15.00</price>
    </book>
    <book>
         <title>Writing Style</title>
         <author>Writer</author>
         <price>1500.00</price>
    </book>
</bookstore>

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <root>
            <xsl:apply-templates select="/bookstore">
                <xsl:with-param name="character" select="'W'" />
            </xsl:apply-templates>
        </root>
    </xsl:template>
    
    <xsl:template match="bookstore">
        <xsl:param name="character" select="''" />
        <xsl:variable name="charMatch" select="book[starts-with(title, $character)]"/>    
        <xsl:variable name="charCount" select="count($charMatch)"/>
        
        <result>
            <char><xsl:value-of select="$character" /></char>
            <count><xsl:value-of select="$charCount" /></count>
            <books>
                <xsl:for-each select="$charMatch">
                    <xsl:copy-of select="." />
                </xsl:for-each>
            </books>
        </result>
    </xsl:template>
</xsl:stylesheet>




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: XSLT passing a variable to starts-with Pin
bjmallon16-Feb-17 18:45
memberbjmallon16-Feb-17 18:45 
GeneralRe: XSLT passing a variable to starts-with Pin
Richard Deeming17-Feb-17 1:48
mveRichard Deeming17-Feb-17 1:48 
GeneralRe: XSLT passing a variable to starts-with Pin
bjmallon20-Feb-17 22:55
memberbjmallon20-Feb-17 22:55 
GeneralRe: XSLT passing a variable to starts-with Pin
Richard Deeming21-Feb-17 1:42
mveRichard Deeming21-Feb-17 1:42 
GeneralRe: XSLT passing a variable to starts-with Pin
bjmallon21-Feb-17 10:24
memberbjmallon21-Feb-17 10:24 
QuestionHow to generate XML file with serialisation in vb.net Pin
Member 1280320219-Oct-16 8:06
memberMember 1280320219-Oct-16 8:06 
Rant[REPOST] How to generate XML file with serialisation in vb.net Pin
Richard Deeming19-Oct-16 9:28
mveRichard Deeming19-Oct-16 9:28 
QuestionTransform the date format from yyyy/mm/dd to mm/dd/yyyy Pin
Member 1278840611-Oct-16 15:21
memberMember 1278840611-Oct-16 15:21 
AnswerRe: Transform the date format from yyyy/mm/dd to mm/dd/yyyy Pin
Richard Deeming12-Oct-16 3:26
mveRichard Deeming12-Oct-16 3:26 
QuestionRead xml string Pin
trungysp198610-Oct-16 14:48
membertrungysp198610-Oct-16 14:48 
AnswerRe: Read xml string Pin
Richard MacCutchan10-Oct-16 21:54
protectorRichard MacCutchan10-Oct-16 21:54 
AnswerRe: Read xml string Pin
Swinkaran11-Oct-16 16:09
professionalSwinkaran11-Oct-16 16:09 
QuestionXML Pin
Member 1273144310-Sep-16 3:41
memberMember 1273144310-Sep-16 3:41 
AnswerRe: XML Pin
OriginalGriff10-Sep-16 3:44
protectorOriginalGriff10-Sep-16 3:44 
GeneralRe: XML Pin
Member 1273144310-Sep-16 3:48
memberMember 1273144310-Sep-16 3:48 
GeneralRe: XML Pin
Member 1273144310-Sep-16 3:52
memberMember 1273144310-Sep-16 3:52 
GeneralRe: XML Pin
OriginalGriff10-Sep-16 4:06
protectorOriginalGriff10-Sep-16 4:06 

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.