|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
xslt with html embedded in the xml doc
I am having a problem with XSLT and I was hoping that you could shed some light on it.
I have a line of text I am referencing in a XML document... Code:
<Text>Remove existing sheet metal at a width of <input_text/> coping and store for reuse.</Text> I have been able to find this node via a template AND I can identify the input_text tag as well. What I want to do is replace the input_text tag with a real HTML tag. I am doing this like so... Find/output the substring before the tag. Then, output the html input element in place of the tag. And finally, output the substring after the tag. The xslt code in question. Code:
<xsl:value-of select="substring-before(text(), '<')"/> <xsl:apply-templates select="input_text"/><BR/> <xsl:value-of select="substring-after(text(), '>')"/> The above template defined. Code:
<xsl:template match="input_text"> <input type="text" name="input_text_'+@id"/> </xsl:template> I looked at the xpath functions and I know I can't use the < or > brackets, I tried escaping the brackets < and > but it isn't associating the tag bracets with the codes. My above code will NOT output any of the substrings. It does output a textbox though. Am I trying to do something that xslt can't do? Any help would be greatly appreciated. Thank you for your time. Last edited by Sm00ve : October 22nd, 2003 at 01:25 PM. |
|
#2
|
|||
|
|||
|
Try this:
Code:
<xsl:template match="input_text"> <input type="text" > <xsl:attribute name="name"> input_text_<xsl:value-of select="@id"/> </xsl:attribute> </input> </xsl:template> Last edited by imbrokn : October 22nd, 2003 at 01:51 PM. |
|
#3
|
|||
|
|||
|
also in regards to your brackets try this
PHP Code:
Last edited by imbrokn : October 22nd, 2003 at 01:45 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > xslt with html embedded in the xml doc |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|