Click here to Skip to main content
15,908,274 members
Home / Discussions / C#
   

C#

 
GeneralRe: DoubleBuffer Exception Pin
John Fisher16-Mar-04 12:48
John Fisher16-Mar-04 12:48 
GeneralRe: DoubleBuffer Exception Pin
Heath Stewart16-Mar-04 3:18
protectorHeath Stewart16-Mar-04 3:18 
QuestionInsert new Array ? Pin
azusakt15-Mar-04 16:24
azusakt15-Mar-04 16:24 
AnswerRe: Insert new Array ? Pin
John Fisher15-Mar-04 17:03
John Fisher15-Mar-04 17:03 
AnswerRe: Insert new Array ? Pin
Heath Stewart16-Mar-04 3:13
protectorHeath Stewart16-Mar-04 3:13 
GeneralConvert from true type font to vector image Pin
Zhang Songling15-Mar-04 15:32
Zhang Songling15-Mar-04 15:32 
GeneralRe: Convert from true type font to vector image Pin
Heath Stewart16-Mar-04 3:09
protectorHeath Stewart16-Mar-04 3:09 
QuestionC# and XSLT [ Bug ] ? Pin
Matthew Hazlett15-Mar-04 14:34
Matthew Hazlett15-Mar-04 14:34 
I can apply an XSLT to an XML document fine in C#.
But an issue occures if the XSLT has a for-each.
For some reason the xmldom seems to ignore it. I have read posts from other people with this problem but no solution, any ideas? (Can some kind person try to reproduce this bug)

Heres the code I use for the transform:

StringWriter sw = new StringWriter();

XmlDocument srcDoc = new XmlDocument();
srcDoc.Load("test.xml");

XslTransform srcXSLT = new XslTransform();
srcXSLT.Load("test.xslt");

srcXSLT.Transform(srcDoc, null, sw);
Output.Text = sw.ToString();


XML Doc:
(Sorry, I made the greater thens less thens and vice versa by accident in this post Smile | :) )

>?xml-stylesheet type="text/xsl" href="sample.xsl"?<
>catalog<
	>book id="bk104"<
		>author<Corets, Eva>/author<
		>title<Oberon's Legacy>/title<
		>genre<Fantasy>/genre<
		>price<5.95>/price<
		>publish_date<2001-03-10>/publish_date<
		>description<In post-apocalypse England, the mysterious>/description<
	>/book<
	>book id="bk106"<
		>author<Randall, Cynthia>/author<
		>title<Lover Birds>/title<
		>genre<Romance>/genre<
		>price<4.95>/price<
		>publish_date<2000-09-02>/publish_date<
		>description<When Carla meets Paul at an ornithology>/description<
	>/book<
>/catalog<


XSL Doc:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
  <xsl:template match="/">
		<html>
			<body>
				<table border="1">
					<tr><td><b>Author</b></td><td><b>Title</b></td></tr>
					<xsl:for-each select="//book">
						<tr>
							<td><xsl:value-of select="author"/></td>
							<td><xsl:value-of select="title"/></td>
						</tr>
					</xsl:for-each>
				</table>
			</body>
		</html>
  </xsl:template>
</xsl:stylesheet>


Here is the output I get:

<html>
  <body>
    <table border="1">
      <tr>
        <td>
          <b>Author</b>
        </td>
        <td>
          <b>Title</b>
        </td>
      </tr>
    </table>
  </body>
</html>


Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
AnswerRe: C# and XSLT [ Bug ] ? Pin
Matthew Hazlett15-Mar-04 19:46
Matthew Hazlett15-Mar-04 19:46 
AnswerRe: C# and XSLT [ Bug ] ? Pin
Heath Stewart16-Mar-04 3:00
protectorHeath Stewart16-Mar-04 3:00 
Generaliterate through enum Pin
Christian Graus15-Mar-04 13:14
protectorChristian Graus15-Mar-04 13:14 
GeneralRe: iterate through enum Pin
Christian Graus15-Mar-04 14:34
protectorChristian Graus15-Mar-04 14:34 
GeneralForms &amp; variables &amp; suchlike Pin
surgeproof15-Mar-04 10:54
surgeproof15-Mar-04 10:54 
GeneralRe: Forms &amp; variables &amp; suchlike Pin
Judah Gabriel Himango15-Mar-04 11:07
sponsorJudah Gabriel Himango15-Mar-04 11:07 
GeneralRe: Forms &amp; variables &amp; suchlike Pin
surgeproof16-Mar-04 8:16
surgeproof16-Mar-04 8:16 
GeneralRe: Forms &amp; variables &amp; suchlike Pin
surgeproof17-Mar-04 6:38
surgeproof17-Mar-04 6:38 
GeneralProcessDialogKey and AppDomain Pin
zilch15-Mar-04 9:37
zilch15-Mar-04 9:37 
GeneralRe: ProcessDialogKey and AppDomain Pin
Heath Stewart15-Mar-04 9:55
protectorHeath Stewart15-Mar-04 9:55 
GeneralRe: ProcessDialogKey and AppDomain Pin
Nemanja Trifunovic15-Mar-04 10:23
Nemanja Trifunovic15-Mar-04 10:23 
GeneralRe: ProcessDialogKey and AppDomain Pin
Heath Stewart15-Mar-04 10:50
protectorHeath Stewart15-Mar-04 10:50 
GeneralRe: ProcessDialogKey and AppDomain Pin
zilch15-Mar-04 10:34
zilch15-Mar-04 10:34 
GeneralRe: ProcessDialogKey and AppDomain Pin
Heath Stewart15-Mar-04 10:48
protectorHeath Stewart15-Mar-04 10:48 
GeneralRe: ProcessDialogKey and AppDomain Pin
zilch15-Mar-04 11:12
zilch15-Mar-04 11:12 
GeneralRe: ProcessDialogKey and AppDomain Pin
Heath Stewart15-Mar-04 11:27
protectorHeath Stewart15-Mar-04 11:27 
GeneralRe: ProcessDialogKey and AppDomain Pin
zilch15-Mar-04 12:43
zilch15-Mar-04 12:43 

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.