Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Integration > Import/Export XML (file .onlv)

Forum

Search UsersRules
Import/Export XML (file .onlv)
#1
Interested
Points:: 0
Joined:: Nov 10, 2011

Hi!

I need to import and then export Line Items of one document. Format of the file is .onlv. The code look like that:

Code
<?xml version="1.0"?>
<onlv xmlns="http://www.oenorm.at/schema/A2063/2009-06-01" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.oenorm.at/schema/A2063/2009-06-01 onlv.xsd" 
xmlns:on="http://www.oenorm.at/schema/A2063/2009-06-01">
  <metadaten>
    <erstelltam>2012-10-10T12:00:00Z</erstelltam>
    <dateiname>ONLVtest2.onlv</dateiname>
    <programmsystem>ORCA AVA</programmsystem>
    <programmversion>18.01.05</programmversion>
  </metadaten>
  <grafiktabelle />
  <leistungsteiltabelle>
    <leistungsteil nr="1">
      <definition>
        <warenkorb>
          <bezeichnung>1</bezeichnung>
        </warenkorb>
      </definition>
    </leistungsteil>
  </leistungsteiltabelle>
  <zugelassenenachlaesse>
    <aufsummen />
    <hierarchiestufen>
      <auflvsumme />
      <aufhgsummen />
      <aufogsummen />
      <auflgsummen />
      <aufulgsummen />
    </hierarchiestufen>
  </zugelassenenachlaesse>
  <ausschreibungs-lv>
...
</ausschreibungs-lv>
</onlv>


Which way would be the best? I think there is a better possibility than just StringFuctions.

Thank you for every advice.

Profile
#2
Just came
Points:: 0
Joined:: Nov 2, 2011

Hi!
You can use XMLReader and XMLWriter objects. You can find an explanation for these objects in a Syntax Assistant.

Profile
#3
Interested
Points:: 0
Joined:: Nov 10, 2011

Thank you for your tip, Grumegargler! I can find a detailed information also in "Practical developer's guide".
Can it be in Common Modules some function DataUploadDownload

WriteNamespaceMapping(<Prefix>, <NamespaceURI>)

with

xsi="http://www.w3.org/2001/XMLSchema-instance"

and

xsi:schemaLocation="http://www.oenorm.at/schema/A2063/2009-06-01 onlv.xsd" ?

And what should I do with:

onlv xmlns="http://www.oenorm.at/schema/A2063/2009-06-01" and
xmlns:on="http://www.oenorm.at/schema/A2063/2009-06-01"?

Profile
#4
Interested
Points:: 0
Joined:: Nov 10, 2011

I also found in a post of Xing Wang an idea how one file can be saved:

WordDocument.SaveAs(TempFilesDir()+"temp.doc");

Can I replace in my case

"temp.doc" by "temp.onlv"?

Profile
#5
Interested
Points:: 0
Joined:: Nov 10, 2011

And additional question:

is it necessary to use XDTOFactory?

Profile
#6
Active user
Points:: 2
Joined:: Sep 16, 2011

In general you might generate XML using TextDocument as a simple text file.

Profile
#7
Guest
Points::
Joined::

XDTOFactory is designed to replace 1C:Script in import/export code with setting up XDTO objects in Designer mode or any other XSD-editor. If you have lots of complicated objects having many attributes, tabular sections and relations between each other, the 1C:Script will become too complicated to design and support.

P.S.: note, that you can import XSD in Designer, so try to get it from the software which you integrate with and then go to Common -> XDTO packages, right click on it and choose Import XML Schema.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.