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

  • SEARCH
  • Home
  • 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 844603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:18:39+00:00 2026-05-15T06:18:39+00:00

I’m getting XML input that looks like this <?xml version=1.0 encoding=utf-8?> <data1>this is data

  • 0

I’m getting XML input that looks like this

<?xml version="1.0" encoding="utf-8"?>
<data1>this is data 1</data1>
<data2>this is data 2</data2>
<data3>
      <3a>this is data 3a</3a>
      <3b>this is data 3b</3b>
      <3c>
            <TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
                    <p direction="ltr" >
                           <span>some text</span>
                           <span>some additional text</span>
                    </p>
                    <p direction="ltr">
                           <span>some text</span>
                           <span>some additional text</span>
                    </p>
             </TextFlow>
       </3c>
</data3>

I can read <data1> with event.result.data1 which outputs a string this is data1

But when I do the same thing to event.result.data3.3c, it prints object [object] so I guess it’s trying to dig deeper into the tree. But I need the actual string text (not xml tree) starting from and including <TextFlow></TextFlow> to be stored and printed as a string. Any idea what’s the syntax for this?

The string I’m looking for would look like this:

        <TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
                <p direction="ltr" >
                       <span>some text</span>
                       <span>some additional text</span>
                </p>
                <p direction="ltr">
                       <span>some text</span>
                       <span>some additional text</span>
                </p>
         </TextFlow>
  • 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-15T06:18:40+00:00Added an answer on May 15, 2026 at 6:18 am

    First, I see a couple of problems with your XML. It’s invalid and it’s kind of surprising that you don’t get an error.

    1) There’s no root node. A simple fix would be putting what you already have in a tag or something more meaninful. But you need to have a root node.

    2) Node names that begin with numbers are a bad idea. Not sure if it’s valid according to the XML spec, but even if it is, it won’t be valid actionscript. In that case, you will have to avoid using dots (instead of data1.3c, something like data1["3c"]. As a general rule, name your nodes just like you name your variables and you’ll be fine.

    If the data within <TextFlow> is meant to be a string, and you are not interested in parsing it, perhaps a better idea is wrapping it in a CDATA section:

    <c3><![CDATA[<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
        <p direction="ltr" >
               <span>some text</span>
               <span>some additional text</span>
        </p>
        <p direction="ltr">
               <span>some text</span>
               <span>some additional text</span>
        </p>
    </TextFlow>]]></c3>
    

    Otherwise, you should use xml namespaces to work with it (notice the <TextFlow> node has a xmlns declaration; xmlns stands for XML namespace.

    You could try something like this to grab it:

    var layout_ns:Namespace = new Namespace("http://ns.adobe.com/textLayout/2008");
    trace(your_xml.data3.c3.layout_ns::TextFlow);
    

    Notice TextFlow is prefixed by the proper namespace.

    An alternative to the above code is setting a default namespace:

    var layout_ns:Namespace = new Namespace("http://ns.adobe.com/textLayout/2008");
    default xml namespace = layout_ns;
    trace(your_xml.data3.c3.TextFlow);
    

    This kind of defeats the purpose of having namespaces in the first place, though.

    PS

    If you go with the second option (i.e. no CDATA), once you get to the node you want, you could use the toXMLString method to get the contents of the node as a string.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.