Replacing self closing tag for empty tag in for XML explicit

  • People,

    I have a tsql code with for XML explicit and when there are empty value the code must be <tag><tag/> instead of

    <tag/>, but I didn't know how to implement it using for XML explicit.

    I can't modify the code to other type of XML modes.

    I need help.

    Best regards.

  • The two are equivalent and any XML parser should be able to handle either of them, so why "must" it be in the form "<tag></tag>"? In fact, "<tag/>" is usually preferred, because it has fewer characters.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • ulisseslourenco (7/7/2016)


    People,

    I have a tsql code with for XML explicit and when there are empty value the code must be <tag><tag/> instead of

    <tag/>, but I didn't know how to implement it using for XML explicit.

    I can't modify the code to other type of XML modes.

    I need help.

    Best regards.

    Out of curiosity, why can't you change the XML mode?

    😎

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply