[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] specific template?


Subject: RE: [xsl] specific template?
From: "Jim Fuller" <jim.fuller@xxxxxxxxxxxxxxxxxx>
Date: Thu, 3 Jul 2003 14:50:01 +0100


> -----Original Message-----
> From: Martin Klaffenboeck [mailto:martin.klaffenboeck@xxxxxx]
> Sent: 03 July 2003 14:30

> <document>
>    <formular name="login" ref="/login/">
>      <field type="text" name="username" size="8" 
> wrap="yes">User</field>
>      <field type="password" name="password" size="8" 
> wrap="yes">Password</field>
>    </formular>
>    <formular name="send_email" ref="/login/send_email">
>      <field type="text" name="email" size="16" 
> wrap="yes">Emailadresse</
> field>
>    </formular>
> </document>
> 
> I'd like to use one template for all formular nodes.  And I 
> want to run 
> apply-templates for every formular specific, how can I do that?
> 
> It's interessting, I have only one
> 
> <xsl:apply-templates select="//formular"/>
> 
> But I get two formulars out, which both have all three fields 
> ( the two 
> from name="login" and the one from name="send_email".

well maybe u dont know about the default built in templates ?
 
> What am I doing wrong?

a bit unsure about your question martin,


<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method = "html" encoding="Windows-1252" />
	
	<xsl:template match="document">	
		<xsl:apply-templates select="formular"/>
	</xsl:template>
	
	<xsl:template match="formular">
	test
	</xsl:template>
</xsl:stylesheet>

the above match template should output 2 'test'.

reframe your question in what u want to do ? if u have an idea of the xml you want to generate from your source xml, maybe u could post that and we will try to help.

cheers, jim fuller



This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient please contact the sender immediately. Any disclosure, copying, distribution or any other use of this communication is strictly prohibitedand may be unlawful. Stuart Lawrence Marketing Communications Limited reserves the right to monitor and intercept communications for unlawful business purposes.

This also confirms that this message has been swept for viruses, although Stuart Lawrence Marketing Communications Limited accepts no responsibility for any loss or damage resulting directly or indirectly from the use of this email or contents.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml