Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
User | Post |
sloat Posts: 19/20 |
You have to define how to show the tag with your stylesheet. Basically, you define an xsl:template block and match "i" (or whatever tag you want to render). In that, you put your html and an 'xsl:value-of select="."' tag
Then, you use xsl:apply-templates instead of xsl:value-of to output, and you should be set. Hope this helps. |
HyperHacker Posts: 3267/5072 |
Alright, another quick question. How can I embed HTML in an XML document, and have it displayed in the output using XSL? For example:
<note>this is <i>italicized</i> text</note> I use XSL to display the contents of "note" nicely, but it ignores the HTML within and just displays "this is italicized text". How do I make it treat the contents as an HTML block, and thus actually italicize the text? If nothing else can I at least put line breaks in somehow? <br /> doesn't work. |
HyperHacker Posts: 2957/5072 |
Well I found a few answers by hacking up a Javascript to load an XML file and report the name/value of various nodes. Specifically the answer to 2, 4 and 5 is yes. As for #3, any letter (obviously) or number, underscore, dash, and period.
Kawa, I assume you meant like "? This makes sense in a web browser where such things are automatically converted, but I'm writing a general-purpose XML parser and don't intend to create a browser. |
MisterJones Posts: 94/125 |
1 and 3 could be answered by this: http://www.webreference.com/html/reference/character/isolat1.html#HEAD-1
I don't recall where i read that xml accepts such convention. |
Kyoufu Kawa Posts: 1017/1353 |
1) Use entities like ".
2) That is right. 3) Common sense says A-Z, a-z, 0-9 and maybe _ and -. 4) Pass 5) Does it? |
HyperHacker Posts: 2936/5072 |
Just some simple questions on what all is valid in XML.
1) What's the standard method to putting a < or > in a tag's value, or a quote in an attribute? 2) Does a comment have to have -- after the ! and before the closing >? 3) What characters are valid in tag/attribute names? 4) Are processing instructions (<?blahblah... ?>) allowed after the closing root tag? Eg like so: <?xml version="1.0" ?> <blah> blahblah </blah> <?something ?> [edit] 5) I noticed that when you have something like this: <blah> text <something/> </blah> a browser creates a node called "#text" for the word "text" between those two tags. Should this be done when there is only whitespace between them? Thanks. |