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 6834059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:03:52+00:00 2026-05-26T23:03:52+00:00

Extracting data from XML I want to preprocess one before sending it as a

  • 0

Extracting data from XML I want to preprocess one before sending it as a variable to template. A stackoverflow fellow pointed me to Ext.Xtemplate and that is close to do the job.

In each of my records I have a value “coordinates” of this pattern : 2.342556,48.873802,0.000000
3 items separated with comma. I need the first and the second.

So I decided to split but It doesn’t work.

My attempt so far (trying to display only one value for testing purposes)

Code:

var tpl = new Ext.XTemplate(        
        '<div>{name}<br>{[ values.coordinates.split(',')[1] ]}</div>'
             );

This echo nothing.
If I display the [0] column of the array it displays the whole string, unsplited. This means that it didn’t parse the comma.

If I split with something else it works (for example with an integer)

Code:

var tpl = new Ext.XTemplate(        
'<div>{name}<br>{[ values.coordinates.split(6)[1] ]}</div>'
         );

I tried to split with the point (‘.’) but it throw an error (“unexpected string”)

Maybe I should use a template member function but the example in the doc are not very clear for me.

Thanks for your help,

Julius

  • 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-26T23:03:53+00:00Added an answer on May 26, 2026 at 11:03 pm

    You need to escape the single quotes or use double quotes like so:

    var tpl = new Ext.XTemplate(        
            '<div>{name}<br>{[ values.coordinates.split(\',\')[1] ]}</div>'
                 );
    

    Otherwise your call will be like this:

    var tpl = new Ext.XTemplate(        
            '<div>{name}<br>{[ values.coordinates.split(',   ')[1] ]}</div>'
                 );
    

    I.E. you pass 2 string parameters instead of 1.

    A similar problem would be with this:

    alert( 'o' 'hi there' );
    

    Except this would throw a syntax error because there is no coincidential comma in there.

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

Sidebar

Related Questions

I'm extracting some information from an XML file, and I want to perform some
I am extracting data from web service(xml file) using NSXmlParser.How can I write to
I have a 12 XML files from which I am extracting ONE CSV file,
I'm extracting data from various sources into one table. In this new table, there's
I am extracting data from XML using XSLT 2.0. The data has long lines
I am extracting some data from SQL Server. One of the columns is a
The two posts below are great examples of different approaches of extracting data from
I seem to be having a problem with extracting data from a stringstream. The
I have an application that extracts data from some xml that is stored in
I am new to perl. I am extracting some nodes information from xml file

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.