XML menu. Attributes text characters spacing disappears

  • arakno
  • Beginner
  • Beginner
  • User avatar
  • Posts: 35
  • Loc: Lisboa

Post 3+ Months Ago

hi all.
I'm reading an XML file to populate a menu from its attributes values. The XML looks like this:
Code: [ Select ]
<?xml version="1.0" encoding="iso-8859-1"?>
<menu nome="Habitação" tag="Architecture Life">
            <item nome="Edifício Reconstrução" tb="8" />
            <item nome="Loteamento e Edifícios" tb="4" />
</menu>
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <menu nome="Habitação" tag="Architecture Life">
  3.             <item nome="Edifício Reconstrução" tb="8" />
  4.             <item nome="Loteamento e Edifícios" tb="4" />
  5. </menu>

And for each node, the attributes are being displayed on their corresponding button textfield, like this:
Code: [ Select ]
var node:Array = XPath.selectNodes(scope, anchor+"/@nome");
for (a in node){
button.textarea.text = node[a].nodeValue;
}
  1. var node:Array = XPath.selectNodes(scope, anchor+"/@nome");
  2. for (a in node){
  3. button.textarea.text = node[a].nodeValue;
  4. }

The strange phenomenon is that , it eats all the spacing between characters. So instead of having "Loteamento e Edifícios" i will get "LoteamentoeEdifícios" alltogheter.
I tested with different fonts and different ways of doing it ( without the XPath classes), but i will get the same result.
Anyone had similar problems??!?[/quote]
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • krismeister
  • Graduate
  • Graduate
  • krismeister
  • Posts: 202

Post 3+ Months Ago

It seems silly, and I don't remember if I've had this problem, make sure you're embedding the space character when you embed your font.
  • arakno
  • Beginner
  • Beginner
  • User avatar
  • Posts: 35
  • Loc: Lisboa

Post 3+ Months Ago

yess indeed, it is silly.
I did embed the space character with the font, i also tried to embed %20 with no luck.
I also did ignoreWhite = false while loading xml but nothing seems to work.
The strangeest thing is that if i insert 2 spaces it renders correctly ( looks like one space) .
I am really desperate just thinking about editing all the xml nodes by hand.
Any other ideas?
  • arakno
  • Beginner
  • Beginner
  • User avatar
  • Posts: 35
  • Loc: Lisboa

Post 3+ Months Ago

I resolved it!
Weirdest thing ever..

I got the original file from a Pdf and after editing it in PSPad I converted it to XML on another program .. Notepad ++.
Alllthough I'm not sure which of the programs ate my spacings , i'm pretty sure it was one of them who screwed them. I don't know much about enconding but it seems to me it has something to do with it.

Thx anyway kris

:P

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 19 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.