Hi Christian,
Alle 10:09, mercoledì 1 agosto 2007, Ionel Maries Cristian
ha scritto:
> eh... that's a start. how about xml processing ? i need
a dom-like access
> and very posibly features like xpath and xsl
transformation.
I think that you could try with the
com.sun.star.xml.dom.DocumentBuilder
service, but I've no experience with it.
This is a quick experimenti that I've just tried:
--------------------8<--------------------
REM ***** BASIC *****
Sub ExampleDOM
oDocBuilder =
createUnoservice("com.sun.star.xml.dom.DocumentBuilder&
quot;)
oUcb =
createUnoService("com.sun.star.ucb.SimpleFileAccess&quo
t;)
sUrl = "file:///home/paolo/CodeSnippet.snip"
oFile = oUcb.OpenFileReadWrite(sUrl)
oXmlDoc = oDocBuilder.parse(oFile.GetInputStream)
'use xray to inspect oXmlDoc and discover how to
'work with child-nodes and xml-attributes
End Sub
--------------------8<--------------------
In alternative you can use a SAX parser:
check the source of the SnippetCreator utility:
http://www.paolo-mantovani.org/downloads/SnippetCreator/
You'll find a starbasic module "ImportXML" that
uses the
com.sun.star.xml.sax.Parser service.
ciao
Paolo M
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|