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. XQuery and Namespace

XQuery and Namespace

Scheduled Pinned Locked Moved Database
databasexmltutorial
4 Posts 3 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.
  • K Offline
    K Offline
    kjfoley1
    wrote on last edited by
    #1

    I have xml files with name space references. If I strip the namespace references from I file, I can read the elements and attributes using xQuery. However, with the namespace references in place, I get no results. I can't figure out how to add the references into the xQuery call. XML SQL SELECT x.value('(patientRole/patient/birthTime/@value)[1]','varchar(50)') as birthDate FROM @XML.nodes( 'declare namespace xlmns="urn:hl7-org:v3"; declare namespace xlmns:voc="urn:hl7-org:v3/voc"; declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; /ClinicalDocument/recordTarget') as Addr (x)

    L K 2 Replies Last reply
    0
    • K kjfoley1

      I have xml files with name space references. If I strip the namespace references from I file, I can read the elements and attributes using xQuery. However, with the namespace references in place, I get no results. I can't figure out how to add the references into the xQuery call. XML SQL SELECT x.value('(patientRole/patient/birthTime/@value)[1]','varchar(50)') as birthDate FROM @XML.nodes( 'declare namespace xlmns="urn:hl7-org:v3"; declare namespace xlmns:voc="urn:hl7-org:v3/voc"; declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; /ClinicalDocument/recordTarget') as Addr (x)

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      http://www.codeproject.com/Messages/4815970/Multiple-namespaces-in-xslt.aspx[^] As Richard said, it's not very polite to crosspost.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      1 Reply Last reply
      0
      • K kjfoley1

        I have xml files with name space references. If I strip the namespace references from I file, I can read the elements and attributes using xQuery. However, with the namespace references in place, I get no results. I can't figure out how to add the references into the xQuery call. XML SQL SELECT x.value('(patientRole/patient/birthTime/@value)[1]','varchar(50)') as birthDate FROM @XML.nodes( 'declare namespace xlmns="urn:hl7-org:v3"; declare namespace xlmns:voc="urn:hl7-org:v3/voc"; declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; /ClinicalDocument/recordTarget') as Addr (x)

        K Offline
        K Offline
        kjfoley1
        wrote on last edited by
        #3

        Thanks for the reply/link but that code is for C# and I'm working in SQL unless I'm missing something. I've never used this site before and haven't figured out the navigation.

        M 1 Reply Last reply
        0
        • K kjfoley1

          Thanks for the reply/link but that code is for C# and I'm working in SQL unless I'm missing something. I've never used this site before and haven't figured out the navigation.

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          kjfoley1 wrote:

          I'm working in SQL unless I'm missing something

          No but it is Richards job/privilege as a protector to reduce cross posting, which this may not be. Sorry to not be of any use - I hate xml.

          Never underestimate the power of human stupidity RAH

          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