Ignore tags in an attribute
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Ignore tags in an attribute

  1. #1
    Join Date
    Oct 2008
    Posts
    9

    Question Ignore tags in an attribute

    Hi!
    How can I ignore XML tags in an attribute in an XML file? For example, if I have a XML file like this:

    Code:
    <sample>
    <sampletag id="my id" description="description cannot contain tags like <tag>" />
    </sample>
    When I access the presented XML file from my application, an error is being raised, because of the enclosed tag in the description attribute. I tried using ![CDATA[ but seems like it is not working for attributes. How can I accomplish the task?

    Thank you!

  2. #2
    Join Date
    Mar 2002
    Location
    NY, USA
    Posts
    12,097

    Re: Ignore tags in an attribute

    Smple...Dont heve invalid XML

    Code:
    <sample>
    <sampletag id="my id" description="description cannot contain tags like &lt;tag&gt;" />
    </sample>
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009
    In theory, there is no difference between theory and paractice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Oct 2008
    Posts
    9

    Re: Ignore tags in an attribute

    Thank you! That worked perfectly.

Tags for this Thread

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center