RE: [xsl] Spaces in Tag Name

Subject: RE: [xsl] Spaces in Tag Name
From: Edward.Middleton@xxxxxxxxxxx
Date: Tue, 7 Jan 2003 11:55:58 +0900
Since this is the XSLT list, here is the xslt solution to your problem.  It should load in Netscape7, IE6 and Mozilla

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xslt"?>
<Table Name="My Table">
	<Column Name="vijay kumar1" Value="Value1"/>
	<Column Name="vijay kumar2" Value="Value2"/>
	<Column Name="vijay kumar3" Value="Value3"/>
	<Column Name="vijay kumar4" Value="Value4"/>
	<Column Name="vijay kumar5" Value="Value5"/>
	<Column Name="vijay kumar6" Value="Value6"/>
</Table>

save the below as test.xslt

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:template match="/">
		<html>
			<head><title><xsl:value-of select="Table/@Name"/></title></head>
		</html>
		<body>
			<xsl:apply-templates select="Table"/>
		</body>
	</xsl:template>
	<xsl:template match="Table">
		<table>
			<xsl:apply-templates/>
		</table>
	</xsl:template>
	<xsl:template match="Column">
		<tr>
			<td>
				<xsl:value-of select="@Name"/>
			</td>
			<td>
				<xsl:value-of select="@Value"/>
			</td>
		</tr>
	</xsl:template>
</xsl:stylesheet>

Edward Middleton

-----Original Message-----
From: Vijaya Kumar Y [mailto:vijayay@xxxxxxxxxxxxxx]
Sent: Monday, January 06, 2003 7:51 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Spaces in Tag Name


yeah i control the creattion of XML file to the format as specified by you
like
<Root>
	   <Column Name="vijay kumar" value = "123"/>
</Root>

after this how to bind this to HTML table using XML-DSO, in that case what
should be the format of the HTML TABLE

-----Original Message-----
From: Edward.Middleton@xxxxxxxxxxx [mailto:Edward.Middleton@xxxxxxxxxxx]
Sent: Monday, January 06, 2003 4:09 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Spaces in Tag Name


1. Do you control the XML creation process?
If you do change it to something like the following.

1.	<Root>
	   <Column Name="vijay kumar">123<Column/>
	</Root>

or even
	<Table>
		<Name>Root</Name>
		<Column><Name>vijay kumar</Name><Value>123</Value></Column>
	</Table>

If you don't, you will need to preprocess the files before you pass them.
Perhaps the following might work for you.

2.	<Root>
	    <vijay-:space:-kumar>123</vijay-:space:-kumar>
	</Root>

Edward Middleton

-----Original Message-----
From: Vijaya Kumar Y [mailto:vijayay@xxxxxxxxxxxxxx]
Sent: Monday, January 06, 2003 7:09 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Cc: Ben@xxxxxxxxxx
Subject: RE: [xsl] Spaces in Tag Name


Hi
   I am reading data from the Database , and the column names  of the table
will become tagename in the XML file
i have a table where the column name is Mfg Name.
in that case how to over come this , as there is a space in the Column name

i hope u got my problem

regards
vijaya kumar


-----Original Message-----
From: Ben Robb [mailto:Ben@xxxxxxxxxx]
Sent: Monday, January 06, 2003 3:25 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Spaces in Tag Name


Why would you want this? As others have said, it is not allowed in an
XML document; tell us what you are trying to achieve by this (and why
you think you need a space in your element name) and we should be able
to point out a solution which does follow the XML specification.

Rgs,

Ben

-----Original Message-----
From: Vijaya Kumar Y [mailto:vijayay@xxxxxxxxxxxxxx] 
Sent: 06 January 2003 09:32
To: Peter Davis; xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Spaces in Tag Name


Hi 
  Sorry here 1 is a part of child also , i dont want that to be a
sepearate attribute


may be i want the XML file to be of this form

<Root>
   <vijay kumar>123</vijay kumar>
<Root>
note there is a space between vijay and kumar

i want the xml file to be of the above form, 
if we can how to load that file or any necessay changes to be done

regards
vijay

-----Original Message-----
From: Peter Davis [mailto:pdavis152@xxxxxxxxx]
Sent: Monday, January 06, 2003 2:52 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; Vijaya Kumar Y
Subject: Re: [xsl] Spaces in Tag Name


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No.

Please see http://www.w3.org/TR/REC-xml#NT-Name

You can use "_" or "-" as an alternative, such as <Child-1>, or use 
attributes such as <Child index="1">.


On Monday 06 January 2003 01:03, Vijaya Kumar Y wrote:
> the quetion is CAN we have a space in the Tag Name for example like
>
> <Root>
>   <Child 1> 12</Child 1>
>   <Child 2> 12212</Child 2>
> </Root>

- -- 
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+GUqfhDAgUT1yirARAjMBAJ9A20kcyzjVFFcRM6xHNiYdiLOfCACdHe/Y
WJ4ykLNirwLr29UqfouBYzg=
=GkJJ
-----END PGP SIGNATURE-----

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


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

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


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

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


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


Current Thread