User Profile
Doug_Marquardt
Copper Contributor
Joined 3 years ago
User Widgets
Recent Discussions
Re: XML Conversion For Node Text Containing &
I finally figured out what my issue was... I didn't understand that the $amp; would be converted to & when reading the node text value with the XML parser. I was viewing the XML in SQL Server results grid. I'm new to XML in SQL Server so this is new to me. Thanks.1.3KViews0likes0CommentsRe: XML Conversion For Node Text Containing &
olafhelper Yes, I realize that... but if I do this it throws an error: Declare @xml xml = ' <SHOP_INSTRUCTIONS> Remove & return to stock. </SHOP_INSTRUCTIONS> '; Select @xml; XML parsing: line 3, character 9, illegal name character So how do I represent & as part of the node text?1.3KViews0likes2CommentsXML Conversion For Node Text Containing &
When I cast a string (which is xml) to the xml data type and the node comments contain & it gets converted to &. For example: Declare @xml xml = ' <SHOP_INSTRUCTIONS> Remove & return to stock. </SHOP_INSTRUCTIONS> '; Select @xml; /* Return This: <SHOP_INSTRUCTIONS> Remove & return to stock. </SHOP_INSTRUCTIONS> */ I would expect the conversion to be: Remove & return to stock. Am I getting the correct results, or what am I missing? Thanks.Solved1.4KViews0likes4Comments
Groups
Recent Blog Articles
No content to show