Vous aurez probablement l'encoder dans votre XML, il ressemble à ceci:
<tableInfo>
<id>1</id>
<htmlInfo>
<html xmlns='w3.org/1999/xhtml'><head ></head> <body><p>xzxzxzxzxz</p> <p>hghghgh</p> </body></html>
</htmlInfo>
<tableInfo>
Donc tous < caractères ont été remplacés par <
et tous> caractères ont été remplacés par >
. Un & doit être &
... Si vous utilisez .NET, n'utilisez pas String.Replace, mais utilisez l'espace de noms System.Xml pour créer correctement un objet XmlDocument. Il fera l'encodage pour vous. Par exemple, dans VB.Net:
Dim stringBuilder As New StringBuilder()
Dim stringWriter As New StringWriter(stringBuilder)
Dim xmlTextWriter As New XmlTextWriter(stringWriter)
xmlTextWriter.WriteStartElement("item")
xmlTextWriter.WriteAttributeString("id", id.ToString())
xmlTextWriter.WriteAttributeString("key", key)
xmlTextWriter.WriteValue(value)
xmlTextWriter.WriteEndElement()
Return stringBuilder.ToString()
Ensuite, votre XSL devrait être capable de le manipuler, et si vous la sortie transformez un fichier HTML par exemple, le <
et d'autres choses doivent être correctement '< 'dans la sortie, et votre HTML devrait être valide.
Pourriez-vous fournir des exemples xml et xsl? – Peter
le Loo xml comme celui-ci Je veux afficher le contenu de la htmlInfo dans mon xsl –
joe
xzxzxzxzxz
hghghgh