Click here to Skip to main content
14,367,061 members
   

XML / XSL

 
AnswerRe: theory xml . help me Pin
George Jonsson4-Dec-15 21:45
professionalGeorge Jonsson4-Dec-15 21:45 
QuestionXML parsing error --> #10; Pin
NJdotnetdev14-Jul-15 3:23
memberNJdotnetdev14-Jul-15 3:23 
AnswerRe: XML parsing error --> #10; Pin
Vinod Jangle5-Aug-15 3:27
memberVinod Jangle5-Aug-15 3:27 
QuestionNETIQ Product Help needed. Pin
Member 1156144127-Mar-15 11:24
memberMember 1156144127-Mar-15 11:24 
AnswerRe: NETIQ Product Help needed. Pin
Richard Andrew x6427-Mar-15 15:14
professionalRichard Andrew x6427-Mar-15 15:14 
AnswerRe: NETIQ Product Help needed. Pin
Abhipal Singh19-May-15 6:07
professionalAbhipal Singh19-May-15 6:07 
Questioncopying attribute from one node to other Pin
ramina sen9-Feb-15 1:10
memberramina sen9-Feb-15 1:10 
QuestionXSL: how to properly reference to xml field? Pin
Maciej Los16-Nov-14 10:05
protectorMaciej Los16-Nov-14 10:05 
I'm looking for a way to properly set xsl:match="..." or xsl:value-of select="..."

My files are:
test.xsl
<?xml version="1.0" encoding="Windows-1250"?>

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="/">
   <!--<xsl:template match="DocumentContent/section[@name]">-->
    <html>
      <head>
        <!-- <link rel="stylesheet" href="zastyles.css"/> -->
      </head>
      <body>
        <h2>SingleRow1</h2>
        <table border="1px" bgcolor="yellow">
            <tr>
                <td><xsl:value-of select="DocumentContent/section['SingleRow1']/row/FieldA"/>
                </td>
                <td><xsl:value-of select="DocumentContent/section['SingleRow1']/row/FieldB"/>
                </td>
                <td><xsl:value-of select="DocumentContent/section['SingleRow1']/row/FieldC"/>
                </td>
                <td><xsl:value-of select="DocumentContent/section['SingleRow1']/row/FieldD"/>
                </td>
            </tr>
        </table>
        <br/>
        <h2>SingleRow2</h2>
        <table border="1px" bgcolor="yellow">
            <tr>
                <td><xsl:value-of select="DocumentContent/section['SingleRow2']/row/FieldA"/>
                </td>
                <td><xsl:value-of select="DocumentContent/section['SingleRow2']/row/FieldB"/>
                </td>
                <td><xsl:value-of select="DocumentContent/section['SingleRow2']/row/FieldC"/>
                </td>
                <td><xsl:value-of select="DocumentContent/section['SingleRow2']/row/FieldD"/>
                </td>
            </tr>
        </table>
        <h2>MulitRow1</h2>
        <table border="1px" bgcolor="lightgreen">
            <xsl:for-each select="DocumentContent/section['MultiRow1']/row">
            <tr>
                <td><xsl:value-of select="Field1"/>
                </td>
                <td><xsl:value-of select="Field2"/>
                </td>
                <td><xsl:value-of select="Field3"/>
                </td>
                <td><xsl:value-of select="Field4"/>
                </td>
            </tr>
            </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>


test.xml
<?xml version="1.0" encoding="windows-1250"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<DocumentContent>
    <section name="SingleRow1">
        <row>
            <FieldA>A</FieldA>
            <FieldB>B</FieldB>
            <FieldC>C</FieldC>
            <FieldD>D</FieldD>
        </row>
    </section>
    <section name="SingleRow2">
        <row>
            <FieldA>E</FieldA>
            <FieldB>F</FieldB>
            <FieldC>G</FieldC>
            <FieldD>H</FieldD>
        </row>
    </section>

    <section name="MultiRow1">
        <row>
            <Field1>1</Field1>
            <Field2>2</Field2>
            <Field3>3</Field3>
            <Field4>4</Field4>
        </row>
        <row>
            <Field1>5</Field1>
            <Field2>6</Field2>
            <Field3>7</Field3>
            <Field4>8</Field4>
        </row>
        <row>
            <Field1>9</Field1>
            <Field2>10</Field2>
            <Field3>11</Field3>
            <Field4>12</Field4>
        </row>
    </section>
</DocumentContent>


The result should be:
SingleRow1
A B C D
SingleRow1
E F D H
MultiRow2
1 2  3  4
5 6  7  8
9 10 11 12

but instead of this i get twice
SingleRow1
A B C D
SingleRow2
A B C D
MultiRow1
3 times empty row
1 2  3  4
5 6  7  8
9 10 11 12

AnswerRe: XSL: how to properly reference to xml field? Pin
Richard Deeming17-Nov-14 3:52
mveRichard Deeming17-Nov-14 3:52 
GeneralRe: XSL: how to properly reference to xml field? Pin
Maciej Los17-Nov-14 5:25
protectorMaciej Los17-Nov-14 5:25 
QuestionHow to get behavior similar to the obsoleted XmlValidatingReader Pin
John Whitmire30-Oct-14 4:53
professionalJohn Whitmire30-Oct-14 4:53 
AnswerRe: How to get behavior similar to the obsoleted XmlValidatingReader Pin
Gerry Schmitz30-Oct-14 22:21
mveGerry Schmitz30-Oct-14 22:21 
GeneralRe: How to get behavior similar to the obsoleted XmlValidatingReader Pin
John Whitmire3-Nov-14 4:04
professionalJohn Whitmire3-Nov-14 4:04 
SuggestionRe: How to get behavior similar to the obsoleted XmlValidatingReader Pin
John Whitmire6-Nov-14 3:47
professionalJohn Whitmire6-Nov-14 3:47 
QuestionVB.NET creat new XML Pin
Dereak12-Oct-14 18:43
memberDereak12-Oct-14 18:43 
AnswerRe: VB.NET creat new XML Pin
Vinod Jangle5-Aug-15 3:28
memberVinod Jangle5-Aug-15 3:28 
QuestionWriting XML from Excel Using VBA Pin
gedkins@deltagl.com30-Sep-14 15:15
membergedkins@deltagl.com30-Sep-14 15:15 
AnswerRe: Writing XML from Excel Using VBA Pin
Richard Deeming1-Oct-14 2:45
mveRichard Deeming1-Oct-14 2:45 
Questiondelimiter or tokenizer in xslt Pin
DanielSatheesh27-Aug-14 2:22
memberDanielSatheesh27-Aug-14 2:22 
AnswerRe: delimiter or tokenizer in xslt Pin
George Jonsson14-Sep-14 0:55
professionalGeorge Jonsson14-Sep-14 0:55 
QuestionMultiple namespaces in xslt Pin
MaryJames7-May-14 23:00
memberMaryJames7-May-14 23:00 
AnswerRe: Multiple namespaces in xslt Pin
Richard MacCutchan7-May-14 23:24
protectorRichard MacCutchan7-May-14 23:24 
GeneralRe: Multiple namespaces in xslt Pin
MaryJames8-May-14 4:16
memberMaryJames8-May-14 4:16 
GeneralRe: Multiple namespaces in xslt Pin
Richard MacCutchan8-May-14 4:19
protectorRichard MacCutchan8-May-14 4:19 
QuestionUse XmlAttributeOverrides, but get an InvalidOperationException nevertheless Pin
Christian Treffler2-Apr-14 9:15
memberChristian Treffler2-Apr-14 9:15 

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.