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. General Programming
  3. Java
  4. How can i add the namepsace into an existing xml

How can i add the namepsace into an existing xml

Scheduled Pinned Locked Moved Java
questionjavaxml
12 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.
  • P piticcotoc

    I have a xml file scanned from a 2d barcode. The creator decided not to include the namespace info into the code so i have to add it after scanning the file. How can I do it in java?

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

    Try some of these[^].

    speaking as ...

    P 1 Reply Last reply
    0
    • L Lost User

      Try some of these[^].

      speaking as ...

      P Offline
      P Offline
      piticcotoc
      wrote on last edited by
      #3

      :sigh:

      L 1 Reply Last reply
      0
      • P piticcotoc

        :sigh:

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

        Is this meant to signify something?

        speaking as ...

        P 1 Reply Last reply
        0
        • L Lost User

          Is this meant to signify something?

          speaking as ...

          P Offline
          P Offline
          piticcotoc
          wrote on last edited by
          #5

          right back at you

          L 1 Reply Last reply
          0
          • P piticcotoc

            right back at you

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

            What?

            speaking as ...

            1 Reply Last reply
            0
            • P piticcotoc

              I have a xml file scanned from a 2d barcode. The creator decided not to include the namespace info into the code so i have to add it after scanning the file. How can I do it in java?

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #7

              piticcotoc wrote:

              so i have to add it

              Why?

              P 1 Reply Last reply
              0
              • J jschell

                piticcotoc wrote:

                so i have to add it

                Why?

                P Offline
                P Offline
                piticcotoc
                wrote on last edited by
                #8

                why what? add it? because i have a xsd file to verify the xml which requires the namespace (otherwise it cannot validate the xml)

                J 1 Reply Last reply
                0
                • P piticcotoc

                  why what? add it? because i have a xsd file to verify the xml which requires the namespace (otherwise it cannot validate the xml)

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #9

                  piticcotoc wrote:

                  (otherwise it cannot validate the xml)

                  Why do you need to validate the xml that you get from a bar code?

                  P 2 Replies Last reply
                  0
                  • J jschell

                    piticcotoc wrote:

                    (otherwise it cannot validate the xml)

                    Why do you need to validate the xml that you get from a bar code?

                    P Offline
                    P Offline
                    piticcotoc
                    wrote on last edited by
                    #10

                    to make sure it was scanned correctly and all the elements are written correctly

                    J 1 Reply Last reply
                    0
                    • J jschell

                      piticcotoc wrote:

                      (otherwise it cannot validate the xml)

                      Why do you need to validate the xml that you get from a bar code?

                      P Offline
                      P Offline
                      piticcotoc
                      wrote on last edited by
                      #11

                      nvm

                      1 Reply Last reply
                      0
                      • P piticcotoc

                        to make sure it was scanned correctly and all the elements are written correctly

                        J Offline
                        J Offline
                        jschell
                        wrote on last edited by
                        #12

                        Are you not going to process it? If so then you could and probably should validate it then. However, there are two possibilities: explicit name space or default. Then you add the url, xsd, and namespace prefix (if not default.) Following link is good enough. Read the comments of the first answer. http://stackoverflow.com/questions/751511/validating-an-xml-against-referenced-xsd-in-c-sharp[^]

                        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