Empty string-vars in XML

Started by HPW, April 05, 2005, 07:23:03 AM

Previous topic - Next topic

HPW

When I exchange lisp-data with XML I get such an stripped down XML:

   <Group1>
      <VAR1>Test</VAR1>
      <VAR2></VAR2>
    </Group1>


When I want it back to lisp I do:



(xml-type-tags nil nil nil nil)

(xml-parse (read-file "myXml.xml")(+ 1 2 4))



I get:



("Group1"
   ("VAR1" "Test")
   ("VAR2")))


Is there any other way to get:

("Group1"
   ("VAR1" "Test")
   ("VAR2" "")))
Hans-Peter

Lutz

#1
This is a bug, wihtout the option number 1 it should show an empty string. This will be fixed in 8.5.0 due by the end of this week.



Lutz

Lutz

#2
After thinking more about it I believe, that putting "" not be legal XML/SXML translation. I don't think that an  an empty tag implies that this is "empty" whilespace,  but I am not quite sure. I will research this when back home in Florida.



Lutz

HPW

#3
>I don't think that an an empty tag implies that this is "empty" whitespace



When this is the case then I have to provide another loop to go through my reimported assoc-lists and fill the missing empty parameters in as a string. Not a big problem. Was only a question after the best way to do it.

I want to get back the list as it was before the converting to XML.

2 way interfacing without any loss.



Ot is there a different way to represent an empty string in XML:



<VAR2>EmptyStringPlaceholder</VAR2>
Hans-Peter

HPW

#4
An observation:



A emty XML tag in the source like this:
<VAR2></VAR2>

Shows in IE:
<VAR2 />
Hans-Peter

eddier

#5
I know html is not xml but I have used <td>&nbsp;</td> to make tables appear correctly in the past. maybe something like <Var2>&empty;</Var2>.



Eddie

Lutz

#6
You always can put a space in there and leeave out the 1 in the options:



(xml-type-tags nil nil nil nil)

(xml-parse "<var> </var>" (+ 2 4 8)) => ((var " "))


Lutz



ps: travelling back to FL today, so this is probably the last time I am on here today