[Gambas-user] xmlreader

roberto rhoct at ...325...
Mon Nov 30 18:36:28 CET 2015


bump
Is There Anybody Out There? (PF)

follow lines  Mtest.module in  gambas/gb.xml/src/gb.xml/.src

Public Sub Main()

Dim writer As New XmlWriter


writer.Open("/tmp/text.xml", True)
writer.Comment("commento")
writer.StartElement("toto")
writer.StartElement("titi")
writer.Attribute("titi", "tutu\ntoto")
writer.Text("h<&ello")
writer.EndElement()
writer.StartElement("titi")
writer.Text("hello")
writer.EndElement()
writer.Element("toto", "hello", "np", "http://np.org")
writer.StartElement("foo", ["fizz", "buzz"], "tx", 
"http://example.com/tx.xml")
writer.StartElement("titi")
writer.Text("hello")
writer.EndElement()
writer.Element("toto", "hello")
writer.Comment("Hidden")
writer.CDATA("Raw Data")
writer.PI("hello", "worldl")
writer.StartElement("titi")
writer.Text("hello")

Print "======"
Print writer.Close()
Print "======"
Print writer.Data

this is the output file /tmp/text.txt

<?xml version="1.0" encoding="UTF-8"?>
<!--commento-->
<toto>
  <titi titi="tutu
toto">h<&ello</titi>
  <!--commento-->
  <titi>hello</titi>
  <np:toto xmlns:np="http://np.org">hello</np:toto>
  <tx:foo xmlns:tx="http://example.com/tx.xml" fizz="buzz">
   <titi>hello</titi>
   <toto>hello</toto>
   <!--Hidden-->
   <![CDATA[Raw Data]]>
   <?hello worldl?>
   <titi>hello</titi>
  </tx:foo>
</toto>

and this is the output of the MTest2.module ( same dir of previous module)

NOTHING

Regards

excellent idea the component gb.web.form



Il 27/11/2015 16:33, roberto ha scritto:
> Hi to All,
>
> I can not read an XML file with comment(s) because when the XmlReader
> reads a line of comment (<!-- blablabla -->) then the read method go
> immediately at the end of the file and EOF is true
>
> it's a bug?
>
> Regards
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>





More information about the User mailing list