srkumar Posted November 21, 2007 Share Posted November 21, 2007 Hi..I am Transforming an XML file with XSLT. The following part is in my XML File<p>It's bright and sunny at Fort Necessity, but you're not interested in the weather. The Pennsylvania woods around you look dark and dangerous. Any minute now, your small fort may be attacked. You're scared, but you will fight to keep France from getting control of this land. There is a shout as one of the other soldiers in your group runs into sight. “It's the French!” he yells. “We're surrounded!”</p>and i want to Transform the xml file with XSLT as<p>It's bright and sunny at Fort Necessity, but you're not interested in the weather. The Pennsylvania woods around you look dark and dangerous. Any minute now, your small fort may be attacked. You're scared, but you will fight to keep France from getting control of this land. There is a shout as one of the other soldiers in your group runs into sight. “It's the French!” he yells. “We're surrounded!”</p>Please Advice...Thanks in Advance,srkumar Link to comment Share on other sites More sharing options...
boen_robot Posted November 21, 2007 Share Posted November 21, 2007 Hi..I am Transforming an XML file with XSLT. The following part is in my XML File<p>It's bright and sunny at Fort Necessity, but you're not interested in the weather. The Pennsylvania woods around you look dark and dangerous. Any minute now, your small fort may be attacked. You're scared, but you will fight to keep France from getting control of this land. There is a shout as one of the other soldiers in your group runs into sight. “It's the French!” he yells. “We're surrounded!”</p>and i want to Transform the xml file with XSLT as<p>It's bright and sunny at Fort Necessity, but you're not interested in the weather. The Pennsylvania woods around you look dark and dangerous. Any minute now, your small fort may be attacked. You're scared, but you will fight to keep France from getting control of this land. There is a shout as one of the other soldiers in your group runs into sight. “It's the French!” he yells. “We're surrounded!”</p>Please Advice...Thanks in Advance,srkumarExactly what are you transforming here? If you are trying to just copy the thing, use <xsl:copy-of/>. If you want to preserve entities (judging by the title of the topic)... why? What you get with a copy is the actual character of the entity if that character can be placed there. If it can't, you automatically get a numeric entity that. So, entity or not, the text result that you get in the end will be the same. Link to comment Share on other sites More sharing options...
srkumar Posted November 22, 2007 Author Share Posted November 22, 2007 Thanks for your reply boen....I am sorry that i have not furnished my query clearly... What i am trying to do is i want to transform the entity into numeric character entity reference from my input xml file to output xml file through xslt....Please Advice...Thanks in Advance,srkumar Exactly what are you transforming here? If you are trying to just copy the thing, use <xsl:copy-of/>. If you want to preserve entities (judging by the title of the topic)... why? What you get with a copy is the actual character of the entity if that character can be placed there. If it can't, you automatically get a numeric entity that. So, entity or not, the text result that you get in the end will be the same. Link to comment Share on other sites More sharing options...
boen_robot Posted November 22, 2007 Share Posted November 22, 2007 Well, again. Why? XSLT automatically uses the numeric entity of a character if necessary (i.e. if it's not supported in the output encoding), and if not, outputs the character directly, in turn reducing file size of the result. Why would you want to break this model? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.