Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6371801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:08:04+00:00 2026-05-25T01:08:04+00:00

I am new to XML and XML attributes. I have read in some XML

  • 0

I am new to XML and XML attributes. I have read in some XML documentation that XML can be represented in 2 ways:

Method-1

<?xml version="1.0" encoding="UTF-8"?>
<CATALOG>
 <CD>
        <TITLE>Empire Burlesque</TITLE>
        <ARTIST>Bob Dylan</ARTIST>
        <COUNTRY>USA</COUNTRY>
        <COMPANY>Columbia</COMPANY>
        <PRICE>10.90</PRICE>
        <YEAR>1985</YEAR>
    </CD>
    <CD>
        <TITLE>Hide your heart</TITLE>
        <ARTIST>Bonnie Tyler</ARTIST>
        <COUNTRY>UK</COUNTRY>
        <COMPANY>CBS Records</COMPANY>
        <PRICE>8.90</PRICE>
        <YEAR>1988</YEAR>
    </CD>
</CATALOG>

Method – 2

<?xml version="1.0" encoding="UTF-8"?>
<CATALOG>
    <CD TITLE="Empire Burlesque" ARTIST="Bob Dylan" COUNTRY="USA" COMPANY="Columbia" PRICE="10.90" YEAR="1985"/>
    <CD TITLE="Hide your heart" ARTIST="Bonnie Tyler" COUNTRY="UK" COMPANY="CBS Records" PRICE="8.90" YEAR="1988"/>
 </CATALOG>

But for example when I am using this function to filter where price >=9 and display the data in a grid.
When using XML Way 1, it works fine, but when I use XML Way 2, the datagrid is empty. Also note that I am using @ Binding at the datafield of each DatagridColumn. My filter function is as such:

private function myFilter(xml:XML):Boolean
            {
                return Number(xml.PRICE) >= 9;
            }

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:08:05+00:00Added an answer on May 25, 2026 at 1:08 am

    In way number 2, the price is an atribute and not a subtag so it should be accessed with the @ symobl.

    So for way 2, your filter function should be:

    private function myFilter(xml:XML):Boolean
                {
                    return Number(xml.@PRICE) >= 9;
                }
    

    Notice the @ before PRICE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following sample XML: <?xml version=1.0 encoding=utf-8 ?> <queryableData> <table displayName=Shipments dbName=Quotes>
I have an xml as shown: <?xml version=1.0 encoding=utf-8?> <Query_advanced> <Query>hy</Query> <Attribute Name1=Patient's Age
My XML File: <?xml version=1.0 encoding=utf-8?> <SimpleKD> <player name=Tardis> <kills>0</kills> <deaths>0</deaths> </player> </SimpleKD> First
I have some xml that looks like this: <rootElement attribute=' > '/> This is
I have an XML document: var xml:XML = new XML(<rootNode> <head> <meta name=template content=Default
still new to XML parsing with the iphone so i have a few questions.
I'm new to querying XML datatype in SQL Server 2005. Anyone can help me
Is there a new version of XML out? If so when was it released
[TestInitialize()] public void MyTestInitialize() { XmlTextWriter writer = new XmlTextWriter(DataFile.xml, Encoding.UTF8); writer.Formatting = Formatting.Indented;
All, I have a config xml file in the following format: <?xml version=1.0?> <configdata>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.