Hallo,

In the past there was he "com.sun.star.comp.JAXTHelper" to make a translation of a XML this stuff is now removed from LO

SaxtHelper is replaced by com.sun.star.comp.documentconversion.LibXSLTTransformer

In the past there was some code (below originated from the Hanja Hermione website) to work with this JAXThelper i tried  the same code but now using com.sun.star.comp.documentconversion.LibXSLTTransformer


No errors but i end up with a empty "out.txt" file

can someone explain how to work with the new stuff or is it simply not possible to make XML transformations using the API.

(the SaxParser is working but to slow for big files)

Greetz

And thanks for any advice

Fernand
Sub Main
  bStarted = True
  oSFA = CreateUnoService( _
    "com.sun.star.ucb.SimpleFileAccess" )
  
  oIn = oSFA.openFileRead("file:///C:/usr/content.xml")
  oOut = oSFA.openFileWrite("file:///C:/usr/out.txt")
  
  Dim aNamed(6) As New com.sun.star.beans.NamedValue
  aNamed(0).Name = "StylesheetURL"
  aNamed(0).Value = "file:///C:/yourXSLT.xsl"
  aNamed(1).Name = "SourceURL"
  aNamed(1).Value = "file:///C:/usr/yourcontent.xml"
  aNamed(2).Name = "TargetURL"
  aNamed(2).Value = "file:///C:/out.txt"
  aNamed(3).Name = "SourceBaseURL"
  aNamed(3).Value = "file:///C:/"
  aNamed(4).Name = "TargetBaseURL"
  aNamed(4).Value = "file:///C:/"
  aNamed(5).Name = "SystemType"
  aNamed(5).Value = ""
  aNamed(6).Name = "PublicType"
  aNamed(6).Value = ""
  
  oStreamListener = CreateUnoListener( "Stream_", _
    "com.sun.star.io.XStreamListener" )
  
  oJAXHelper = CreateUnoService( _
      "om.sun.star.comp.documentconversion.LibXSLTTransformer " )
  oJAXHelper.initialize(aNamed)
  oJAXHelper.addListener(oStreamListener)
  oJAXHelper.setInputStream(oIn)
  oJAXHelper.setOutputStream(oOut)
  
  ' start translation
  oJAXHelper.start()
  
  ' needs to wait the end of translation
  While bStarted
    wait 100
  WEnd
  
  oJAXHelper.removeListener(oStreamListener)
  oIn.closeInput()
  oOut.closeOutput()
End Sub


_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to