Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. I keep running into xml format issues in various editors ... please advise

I keep running into xml format issues in various editors ... please advise

Scheduled Pinned Locked Moved Database
databasesql-servercsharpsysadminxml
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RedDk
    wrote on last edited by
    #1

    I have a SQL Server project that I'm currently adding code to using SSMSE2k8 and beside the fact that this is all TSQL, there's this creep that's occuring in the facility. Namely the .xml. Now, here's the more technical side of TSQL as related to XML, using a FOR XML PATH juncture. I can do a basic SELECT query and get output of xml (pseudo output really because ... this is the creep; in ssmse that's as far as development WENT) but I'm constrained by all these substitutions in he editor: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document> Control characters! What's the purpose of eliminating right & left arrows ... anyway? And how might I preserve them and keep the phantom formatter from invading my ... "style" (if you could call it that)? [Edit] And wouldn't you know it? This phantom has got me here in a paste! That tagged string up there in the midst of my paragraph is suposed to be:

    <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document>

    [End edit]

    R D 3 Replies Last reply
    0
    • R RedDk

      I have a SQL Server project that I'm currently adding code to using SSMSE2k8 and beside the fact that this is all TSQL, there's this creep that's occuring in the facility. Namely the .xml. Now, here's the more technical side of TSQL as related to XML, using a FOR XML PATH juncture. I can do a basic SELECT query and get output of xml (pseudo output really because ... this is the creep; in ssmse that's as far as development WENT) but I'm constrained by all these substitutions in he editor: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document> Control characters! What's the purpose of eliminating right & left arrows ... anyway? And how might I preserve them and keep the phantom formatter from invading my ... "style" (if you could call it that)? [Edit] And wouldn't you know it? This phantom has got me here in a paste! That tagged string up there in the midst of my paragraph is suposed to be:

      <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document>

      [End edit]

      R Offline
      R Offline
      RedDk
      wrote on last edited by
      #2

      Wow, Could have knocked me over with a feather ... the reason that my editor (was) going south was because of the type I had used to reassign parsed lines of singleline .xml while striking it up as data in a table!. [nvarchar](MAX) throws (bad use of an alliteration) the phantom formatter into overdrive, while [xml] is silently overlooked. Thus arrows are preserved.

      1 Reply Last reply
      0
      • R RedDk

        I have a SQL Server project that I'm currently adding code to using SSMSE2k8 and beside the fact that this is all TSQL, there's this creep that's occuring in the facility. Namely the .xml. Now, here's the more technical side of TSQL as related to XML, using a FOR XML PATH juncture. I can do a basic SELECT query and get output of xml (pseudo output really because ... this is the creep; in ssmse that's as far as development WENT) but I'm constrained by all these substitutions in he editor: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document> Control characters! What's the purpose of eliminating right & left arrows ... anyway? And how might I preserve them and keep the phantom formatter from invading my ... "style" (if you could call it that)? [Edit] And wouldn't you know it? This phantom has got me here in a paste! That tagged string up there in the midst of my paragraph is suposed to be:

        <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document>

        [End edit]

        D Offline
        D Offline
        Davidduraisamy
        wrote on last edited by
        #3

        To avoid XML Escape Characters (" ",' '< <> >& &) Use this: FOR XML PATH(''), TYPE).value('.', 'VARCHAR(MAX)')

        1 Reply Last reply
        0
        • R RedDk

          I have a SQL Server project that I'm currently adding code to using SSMSE2k8 and beside the fact that this is all TSQL, there's this creep that's occuring in the facility. Namely the .xml. Now, here's the more technical side of TSQL as related to XML, using a FOR XML PATH juncture. I can do a basic SELECT query and get output of xml (pseudo output really because ... this is the creep; in ssmse that's as far as development WENT) but I'm constrained by all these substitutions in he editor: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document> Control characters! What's the purpose of eliminating right & left arrows ... anyway? And how might I preserve them and keep the phantom formatter from invading my ... "style" (if you could call it that)? [Edit] And wouldn't you know it? This phantom has got me here in a paste! That tagged string up there in the midst of my paragraph is suposed to be:

          <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document>

          [End edit]

          D Offline
          D Offline
          Davidduraisamy
          wrote on last edited by
          #4

          Have you got the result...

          R 1 Reply Last reply
          0
          • D Davidduraisamy

            Have you got the result...

            R Offline
            R Offline
            RedDk
            wrote on last edited by
            #5

            My bad, The original code that I used as the query:

            SELECT [xmliform] AS 'data()' FROM [database].[xml].[tblXMLAsTypeNvarchar] FOR XML PATH('')

            So, as you can see, an editor will try to format anything from a table where the type is [nvarchar] using it's xml parser when I specify "FOR XML PATH" regardless of how bad I "want" it as xml. And that is with substituted control characters.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups