Results 1 to 8 of 8

Thread: [RESOLVED] Hypothetical XML question

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Resolved [RESOLVED] Hypothetical XML question

    We know that when assigning values to attributes, we put the values in double quotes. Like this:

    <tagname attr="abc">

    If there is a double quote in the value, you go:

    <tagname attr='ab"c'>

    If there is a single quote, it's as the first one:

    <tagname attr="ab'c">

    Here's the question. What if the value has both single and double quotes?

  2. #2
    Fanatic Member kaihirst's Avatar
    Join Date
    Jul 2005
    Location
    The Resaurant At the End of The Universe
    Posts
    633

    Re: Hypothetical XML question

    Hi,

    you'd either use 7 or 8 bit ascii character code references.

    Kai
    As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..

    A few things that make a good Developer a Great One.
    Methodical and a thorough approach to research and design inevitably leads to success.
    Forward thinking is the key to Flow of control.
    Never test in the design environment, always test in real time, you get the REAL results.
    CBSE & OOSE are the same animal, they just require different techniques, and thinking.
    SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
    The key to good design is explicit attention to both detail and response.
    Think Freely out of the "Box" you're in..... You will soar to better heights.

    Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT


  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Hypothetical XML question

    Apparently you can use the following codes instead of the quote characters:

    &quot; = "
    &apos; = '

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Hypothetical XML question

    Explain?

    Are you talking about using &quot; in there? Would that work in an attribute?

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Hypothetical XML question

    I am indeed talking about using the &quot; in there, such as this:

    <tagname attr="ab'c&quot;d"> (= ab'c"d)

    I haven't tried it myself, but it makes sense, as HTML supports the same escape method.

  6. #6

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Hypothetical XML question

    Quote Originally Posted by si_the_geek
    I am indeed talking about using the &quot; in there, such as this:

    <tagname attr="ab'c&quot;d"> (= ab'c"d)

    I haven't tried it myself, but it makes sense, as HTML supports the same escape method.
    You're riiight.

    Btw, I posted at the same time as you, so my second question now looks really really stupid. Thanks, si. I can always count on you.

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: [RESOLVED] Hypothetical XML question

    Don't use &apos;, it doesn't work in IE.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] Hypothetical XML question

    Yes, &apos; is &evil;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width