Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Translating "Almost XHTML" to XHTML

Status
Not open for further replies.

Luzian

Programmer
Nov 27, 2005
103
US
I want to translate an almost-XHTML document to standard XHTML

Almost-XHTML: This will be a document that is XHTML, except that it will have my own custom controls (elements) in addition to html.

Of course my problem is not knowing how to do this.

[COLOR=white black]Before:[/color]
Code:
<?xml [navy]version[/navy]=[green]"1.0"[/green] [navy]encoding[/navy]=[green]"UTF-8"[/green]?>
<?xml-stylesheet [navy]type[/navy]=[green]"text/xsl"[/green] [navy]href[/navy]=[green]"NeedATranslator.xsl"[/green] ?>
[gray]<!--
	This is the document in need of translation.
	
	I want to retain the entire document with the exception 
	of my custom controls in which I wish to translate.
-->[/gray]
<[b]html[/b] [navy]xmlns:My[/navy]=[green]"[URL unfurl="true"]http://www.Nowhere.com/My"[/URL][/green]>
    <[b]head[/b]>
    	<[b]title[/b]>A title</[b]title[/b]>
    </[b]head[/b]>
	<[b]body[/b]>
		[gray]<!-- here is my custom control (element) -->[/gray]
		<[b]My:DataTable[/b] [navy]DatabaseName[/navy]=[green]"Northwind"[/green] [navy]Sql[/navy]=[green]"SELECT * FROM Customers"[/green]>
		</[b]My:DataTable[/b]>
		
	    <[b]p[/b]>Hello world</[b]p[/b]>
	</[b]body[/b]>
</[b]html[/b]>


[COLOR=white black]After:[/color]
Code:
<?xml [navy]version[/navy]=[green]"1.0"[/green] [navy]encoding[/navy]=[green]"UTF-8"[/green]?>
[gray]<!--
	This is the XHTML document I want it to look like after translation.
-->[/gray]
<[b]html[/b]>
    <[b]head[/b]>
    	<[b]title[/b]>A title</[b]title[/b]>
    </[b]head[/b]>
	<[b]body[/b]>
		[gray]<!-- here is my custom control translated to a table (in this instance) -->[/gray]
		<[b]table[/b]>
			<[b]tr[/b]>
				<[b]th[/b]>Firstname</[b]th[/b]>
				<[b]th[/b]>LastName</[b]th[/b]>
				<[b]th[/b]>Blah blah blah</[b]th[/b]>
			</[b]tr[/b]>
			<[b]tr[/b]>
				<[b]td[/b]>Joe</[b]td[/b]>
				<[b]td[/b]>Smith</[b]td[/b]>
				<[b]td[/b]>Blah blah blah</[b]td[/b]>
			</[b]tr[/b]>
		</[b]table[/b]>
		[gray]<!-- All other html is retained exactly as it were -->[/gray]
	    <[b]p[/b]>Hello world</[b]p[/b]>
	</[b]body[/b]>
</[b]html[/b]>
 
What are you using? What does your control mean? Is it a .Net custom control? How are you pulling from the database?

Jon

"I don't regret this, but I both rue and lament it.
 
JontyMC said:
What are you using? What does your control mean? Is it a .Net custom control? How are you pulling from the database?
Technologies I will use are:
[ul]
[li]xml[/li]
[li]xslt[/li]
[li]javascript (out of the scope of this question)[/li]
[li]asp or php (out of the scope of this question)[/li]
[/ul]
"What does your control mean?"
Doesn't matter what it means. I don't exactly know yet. What matters is how I convert (via XSLT) this element into another element.

"Is it a .Net custom control?"
Although it looks like one, no it isn't. But it will have the same concept without using the asp.net technology.

"How are you pulling from the database?"
Dude, this really doesn't matter.

This is an XSLT issue. Sorry for the confusion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top