Re: [Flashcoders] Decoding xml text w/no CDATA allowed

2006-07-26 Thread Toon Van de Putte

That does appear to be the case,  i tried the following:

textfield.htmlText = currentPand.firstChild;

which shows 'bthis is bold/b' instead of bold text

On the other hand, this:

textfield.htmlText = currentPand.firstChild.nodeValue;

Shows the text in bold, as would be expected. So i suppose using nodeValue
automatically decodes the entities.


On 6/7/06, Merrill, Jason [EMAIL PROTECTED] wrote:


Thanks Ryan, that's what I was looking for.  So this must be a failing
of XFactorstudio's Xpath classes - and Flash's xml.parseXML() or
nodeValue does the decoding automatically?  Or does anyone know a way to
get Xfactorstudios Xpath classes to decode entities?

Jason Merrill
Bank of America
Learning Technology Solutions







-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Ryan Matsikas
Sent: Wednesday, June 07, 2006 11:30 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed

Why not let flash do the work for you?

function convertEntities(p_str:String):String {
var x:XML = new XML(p_str);
x.parseXML();
return x.firstChild.firstChild.nodeValue;
}

var xmlStr:String = 'itemThis is the quot;String I want in
quotesquot;
please help./item';
trace(convertEntities(xmlStr)); // This is the String I want in
quotes
please help.


On 6/7/06, Merrill, Jason  [EMAIL PROTECTED] wrote:

 Jim - I tried out your static class and it works great for my
problem -
 thanks!

 Jason Merrill
 Bank of America
 Learning Technology Solutions







 -Original Message-
 From: [EMAIL PROTECTED]
[mailto: flashcoders-
 [EMAIL PROTECTED] On Behalf Of Jim Cheng
 Sent: Tuesday, June 06, 2006 6:39 PM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed
 
 Merrill, Jason wrote:
 
  Is there an Actionscript 2.0 or Xpath equivalent to Javascript
and
  Actionscript 3.0's
 
  decode(theStringWithquot;Specialquot;Characters);
 
 Hey Jason,
 
 I've run into the same issue about a month ago with XML documents
that
 a
 client had generated from their database, character entities
included.
 
 I couldn't find a built-in solution for converting the character
 entities back into Unicode characters, so I went online, found the
 specs, wrote a little scraper utility to grab the mappings for me
and
 then wrote a small utility class to use the data for encoding and
 decoding. It's a simple static class with inline JavaDoc-style
 documentation.  Hope this works for you.
 
 You can grab it here:
 
  http://dev.psalterego.com/CharacterEntity.as
 
 
 Regards,
 Jim
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
 Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
 http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
Toon Van de Putte
Pannenhuisstraat 63
2500 Lier
Belgium

mobile: +32 (0)497 52 74 51

[EMAIL PROTECTED]
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Decoding xml text w/no CDATA allowed

2006-07-26 Thread Carl Welch

I think you just need to set the Dynamic text field to render HTML in
the properties panel - its the button that looks like . I have xml
that has quot;Specialquot; and it works fine.

On 7/26/06, Toon Van de Putte [EMAIL PROTECTED] wrote:

That does appear to be the case,  i tried the following:

textfield.htmlText = currentPand.firstChild;

which shows 'bthis is bold/b' instead of bold text

On the other hand, this:

textfield.htmlText = currentPand.firstChild.nodeValue;

Shows the text in bold, as would be expected. So i suppose using nodeValue
automatically decodes the entities.


On 6/7/06, Merrill, Jason [EMAIL PROTECTED] wrote:

 Thanks Ryan, that's what I was looking for.  So this must be a failing
 of XFactorstudio's Xpath classes - and Flash's xml.parseXML() or
 nodeValue does the decoding automatically?  Or does anyone know a way to
 get Xfactorstudios Xpath classes to decode entities?

 Jason Merrill
 Bank of America
 Learning Technology Solutions







 -Original Message-
 From: [EMAIL PROTECTED] [mailto:flashcoders-
 [EMAIL PROTECTED] On Behalf Of Ryan Matsikas
 Sent: Wednesday, June 07, 2006 11:30 AM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed
 
 Why not let flash do the work for you?
 
 function convertEntities(p_str:String):String {
 var x:XML = new XML(p_str);
 x.parseXML();
 return x.firstChild.firstChild.nodeValue;
 }
 
 var xmlStr:String = 'itemThis is the quot;String I want in
 quotesquot;
 please help./item';
 trace(convertEntities(xmlStr)); // This is the String I want in
 quotes
 please help.
 
 
 On 6/7/06, Merrill, Jason  [EMAIL PROTECTED] wrote:
 
  Jim - I tried out your static class and it works great for my
 problem -
  thanks!
 
  Jason Merrill
  Bank of America
  Learning Technology Solutions
 
 
 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
 [mailto: flashcoders-
  [EMAIL PROTECTED] On Behalf Of Jim Cheng
  Sent: Tuesday, June 06, 2006 6:39 PM
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed
  
  Merrill, Jason wrote:
  
   Is there an Actionscript 2.0 or Xpath equivalent to Javascript
 and
   Actionscript 3.0's
  
   decode(theStringWithquot;Specialquot;Characters);
  
  Hey Jason,
  
  I've run into the same issue about a month ago with XML documents
 that
  a
  client had generated from their database, character entities
 included.
  
  I couldn't find a built-in solution for converting the character
  entities back into Unicode characters, so I went online, found the
  specs, wrote a little scraper utility to grab the mappings for me
 and
  then wrote a small utility class to use the data for encoding and
  decoding. It's a simple static class with inline JavaDoc-style
  documentation.  Hope this works for you.
  
  You can grab it here:
  
   http://dev.psalterego.com/CharacterEntity.as
  
  
  Regards,
  Jim
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 ___
  Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
  http://training.figleaf.com
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




--
Toon Van de Putte
Pannenhuisstraat 63
2500 Lier
Belgium

mobile: +32 (0)497 52 74 51

[EMAIL PROTECTED]
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Carl Welch
http://www.carlwelch.com
[EMAIL PROTECTED]
805.403.4819
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search

RE: [Flashcoders] Decoding xml text w/no CDATA allowed

2006-07-26 Thread Merrill, Jason
I think you just need to set the Dynamic text field to render HTML in
the properties panel - its the button that looks like . I have xml
that has quot;Specialquot; and it works fine 

Actually, this original thread (almost two months old now) was about
character entities in XML related to the xfactorstudio's Xpath classes -
rather different subject than character entities in HTML from XML text.
The solution I reached with the help of this list was to use a trick
with the XML class:

function decodeEntities(entityString:String):String {
var x:XML = new XML(n+entityString+/n); 
x.parseXML();
return x.firstChild.firstChild.nodeValue;
};

Jason Merrill
Bank of America 
Learning  Organization Effectiveness - Technology Solutions 
 
 
 
 
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Carl Welch
Sent: Wednesday, July 26, 2006 4:17 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed

I think you just need to set the Dynamic text field to render HTML in
the properties panel - its the button that looks like . I have xml
that has quot;Specialquot; and it works fine.

On 7/26/06, Toon Van de Putte [EMAIL PROTECTED] wrote:
 That does appear to be the case,  i tried the following:

 textfield.htmlText = currentPand.firstChild;

 which shows 'bthis is bold/b' instead of bold text

 On the other hand, this:

 textfield.htmlText = currentPand.firstChild.nodeValue;

 Shows the text in bold, as would be expected. So i suppose using
nodeValue
 automatically decodes the entities.


 On 6/7/06, Merrill, Jason [EMAIL PROTECTED] wrote:
 
  Thanks Ryan, that's what I was looking for.  So this must be a
failing
  of XFactorstudio's Xpath classes - and Flash's xml.parseXML() or
  nodeValue does the decoding automatically?  Or does anyone know a
way to
  get Xfactorstudios Xpath classes to decode entities?
 
  Jason Merrill
  Bank of America
  Learning Technology Solutions
 
 
 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
[mailto:flashcoders-
  [EMAIL PROTECTED] On Behalf Of Ryan Matsikas
  Sent: Wednesday, June 07, 2006 11:30 AM
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed
  
  Why not let flash do the work for you?
  
  function convertEntities(p_str:String):String {
  var x:XML = new XML(p_str);
  x.parseXML();
  return x.firstChild.firstChild.nodeValue;
  }
  
  var xmlStr:String = 'itemThis is the quot;String I want in
  quotesquot;
  please help./item';
  trace(convertEntities(xmlStr)); // This is the String I want in
  quotes
  please help.
  
  
  On 6/7/06, Merrill, Jason  [EMAIL PROTECTED]
wrote:
  
   Jim - I tried out your static class and it works great for my
  problem -
   thanks!
  
   Jason Merrill
   Bank of America
   Learning Technology Solutions
  
  
  
  
  
  
  
   -Original Message-
   From: [EMAIL PROTECTED]
  [mailto: flashcoders-
   [EMAIL PROTECTED] On Behalf Of Jim Cheng
   Sent: Tuesday, June 06, 2006 6:39 PM
   To: Flashcoders mailing list
   Subject: Re: [Flashcoders] Decoding xml text w/no CDATA
allowed
   
   Merrill, Jason wrote:
   
Is there an Actionscript 2.0 or Xpath equivalent to
Javascript
  and
Actionscript 3.0's
   
decode(theStringWithquot;Specialquot;Characters);
   
   Hey Jason,
   
   I've run into the same issue about a month ago with XML
documents
  that
   a
   client had generated from their database, character entities
  included.
   
   I couldn't find a built-in solution for converting the
character
   entities back into Unicode characters, so I went online,
found the
   specs, wrote a little scraper utility to grab the mappings
for me
  and
   then wrote a small utility class to use the data for
encoding and
   decoding. It's a simple static class with inline
JavaDoc-style
   documentation.  Hope this works for you.
   
   You can grab it here:
   
http://dev.psalterego.com/CharacterEntity.as
   
   
   Regards,
   Jim
   ___
   Flashcoders@chattyfig.figleaf.com
   To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
   
   Brought to you by Fig Leaf Software
   Premier Authorized Adobe Consulting and Training
   http://www.figleaf.com
   http://training.figleaf.com
   ___
   Flashcoders@chattyfig.figleaf.com
   To change your subscription options or search the archive:
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
   Brought to you by Fig Leaf Software
   Premier Authorized Adobe Consulting and Training
   http://www.figleaf.com
   http://training.figleaf.com
  
  ___
   Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http

RE: [Flashcoders] Decoding xml text w/no CDATA allowed

2006-06-07 Thread Merrill, Jason
Hey thanks Jim - I'll try this out.  Looks like there is a
decode(string) function in Actionscript 3.0, so hopefully this issue
will go away when the 9 player gains wide acceptance.  Thanks for the
link.

Jason Merrill
Bank of America 
Learning Technology Solutions
 
 
 
 
 
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Jim Cheng
Sent: Tuesday, June 06, 2006 6:39 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed

Merrill, Jason wrote:

 Is there an Actionscript 2.0 or Xpath equivalent to Javascript and
 Actionscript 3.0's

 decode(theStringWithquot;Specialquot;Characters);

Hey Jason,

I've run into the same issue about a month ago with XML documents that
a
client had generated from their database, character entities included.

I couldn't find a built-in solution for converting the character
entities back into Unicode characters, so I went online, found the
specs, wrote a little scraper utility to grab the mappings for me and
then wrote a small utility class to use the data for encoding and
decoding. It's a simple static class with inline JavaDoc-style
documentation.  Hope this works for you.

You can grab it here:

 http://dev.psalterego.com/CharacterEntity.as


Regards,
Jim
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Decoding xml text w/no CDATA allowed

2006-06-07 Thread Merrill, Jason
Jim - I tried out your static class and it works great for my problem -
thanks!

Jason Merrill
Bank of America 
Learning Technology Solutions
 
 
 
 
 
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Jim Cheng
Sent: Tuesday, June 06, 2006 6:39 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed

Merrill, Jason wrote:

 Is there an Actionscript 2.0 or Xpath equivalent to Javascript and
 Actionscript 3.0's

 decode(theStringWithquot;Specialquot;Characters);

Hey Jason,

I've run into the same issue about a month ago with XML documents that
a
client had generated from their database, character entities included.

I couldn't find a built-in solution for converting the character
entities back into Unicode characters, so I went online, found the
specs, wrote a little scraper utility to grab the mappings for me and
then wrote a small utility class to use the data for encoding and
decoding. It's a simple static class with inline JavaDoc-style
documentation.  Hope this works for you.

You can grab it here:

 http://dev.psalterego.com/CharacterEntity.as


Regards,
Jim
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Decoding xml text w/no CDATA allowed

2006-06-07 Thread Ryan Matsikas

Why not let flash do the work for you?

function convertEntities(p_str:String):String {
   var x:XML = new XML(p_str);
   x.parseXML();
   return x.firstChild.firstChild.nodeValue;
}

var xmlStr:String = 'itemThis is the quot;String I want in quotesquot;
please help./item';
trace(convertEntities(xmlStr)); // This is the String I want in quotes
please help.


On 6/7/06, Merrill, Jason [EMAIL PROTECTED] wrote:


Jim - I tried out your static class and it works great for my problem -
thanks!

Jason Merrill
Bank of America
Learning Technology Solutions







-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Jim Cheng
Sent: Tuesday, June 06, 2006 6:39 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed

Merrill, Jason wrote:

 Is there an Actionscript 2.0 or Xpath equivalent to Javascript and
 Actionscript 3.0's

 decode(theStringWithquot;Specialquot;Characters);

Hey Jason,

I've run into the same issue about a month ago with XML documents that
a
client had generated from their database, character entities included.

I couldn't find a built-in solution for converting the character
entities back into Unicode characters, so I went online, found the
specs, wrote a little scraper utility to grab the mappings for me and
then wrote a small utility class to use the data for encoding and
decoding. It's a simple static class with inline JavaDoc-style
documentation.  Hope this works for you.

You can grab it here:

 http://dev.psalterego.com/CharacterEntity.as


Regards,
Jim
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Decoding xml text w/no CDATA allowed

2006-06-07 Thread Merrill, Jason
Thanks Ryan, that's what I was looking for.  So this must be a failing
of XFactorstudio's Xpath classes - and Flash's xml.parseXML() or
nodeValue does the decoding automatically?  Or does anyone know a way to
get Xfactorstudios Xpath classes to decode entities?

Jason Merrill
Bank of America 
Learning Technology Solutions
 
 
 
 
 
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Ryan Matsikas
Sent: Wednesday, June 07, 2006 11:30 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed

Why not let flash do the work for you?

function convertEntities(p_str:String):String {
var x:XML = new XML(p_str);
x.parseXML();
return x.firstChild.firstChild.nodeValue;
}

var xmlStr:String = 'itemThis is the quot;String I want in
quotesquot;
please help./item';
trace(convertEntities(xmlStr)); // This is the String I want in
quotes
please help.


On 6/7/06, Merrill, Jason [EMAIL PROTECTED] wrote:

 Jim - I tried out your static class and it works great for my
problem -
 thanks!

 Jason Merrill
 Bank of America
 Learning Technology Solutions







 -Original Message-
 From: [EMAIL PROTECTED]
[mailto:flashcoders-
 [EMAIL PROTECTED] On Behalf Of Jim Cheng
 Sent: Tuesday, June 06, 2006 6:39 PM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] Decoding xml text w/no CDATA allowed
 
 Merrill, Jason wrote:
 
  Is there an Actionscript 2.0 or Xpath equivalent to Javascript
and
  Actionscript 3.0's
 
  decode(theStringWithquot;Specialquot;Characters);
 
 Hey Jason,
 
 I've run into the same issue about a month ago with XML documents
that
 a
 client had generated from their database, character entities
included.
 
 I couldn't find a built-in solution for converting the character
 entities back into Unicode characters, so I went online, found the
 specs, wrote a little scraper utility to grab the mappings for me
and
 then wrote a small utility class to use the data for encoding and
 decoding. It's a simple static class with inline JavaDoc-style
 documentation.  Hope this works for you.
 
 You can grab it here:
 
  http://dev.psalterego.com/CharacterEntity.as
 
 
 Regards,
 Jim
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Decoding xml text w/no CDATA allowed

2006-06-06 Thread Merrill, Jason
Is there an Actionscript 2.0 or Xpath equivalent to Javascript and
Actionscript 3.0's 

decode(theStringWithquot;Specialquot;Characters);

I am receiving an XML string from a webservice created by a .NET
developer - the text node that comes to me as:

item
This is the quot;String I want in quotesquot; please help.
/item

I am using Xpath (item/text())to read the text node, but of course get
the literal quot; instead of .  The .NET developers said it's too much
work to go back and either 1) Make the XML values as node attributes
(which would escape/decode fine with Xpath, I tested it), or 2) Enclose
the text nodes in CDATA and add literal  characters.  So is there a
decode method in Actioscript?

I hate to write a find and replace function in Actionscript, but I might
have to do that - but then I have to account for any possible character
I might receive in the future. Is that my only option at this point?  If
this is the only way, anyone have a good find and replace method?

Thanks

Jason Merrill
Bank of America 
Learning Technology Solutions
 
 


 
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Decoding xml text w/no CDATA allowed

2006-06-06 Thread Jim Cheng

Merrill, Jason wrote:


Is there an Actionscript 2.0 or Xpath equivalent to Javascript and
Actionscript 3.0's 


decode(theStringWithquot;Specialquot;Characters);


Hey Jason,

I've run into the same issue about a month ago with XML documents that a 
client had generated from their database, character entities included.


I couldn't find a built-in solution for converting the character 
entities back into Unicode characters, so I went online, found the 
specs, wrote a little scraper utility to grab the mappings for me and 
then wrote a small utility class to use the data for encoding and 
decoding. It's a simple static class with inline JavaDoc-style 
documentation.  Hope this works for you.


You can grab it here:

http://dev.psalterego.com/CharacterEntity.as


Regards,
Jim
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com