Import/Export XML (file .onlv)

1C:Enterprise platform integration capabilities and techniques

#1
People who like this:0Yes/0No
Interested
Rating: 11
Joined: Nov 10, 2011
Company: 1A Software e.U

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.

 
#2
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Nov 2, 2011
Company:

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

 
#3
People who like this:0Yes/0No
Interested
Rating: 11
Joined: Nov 10, 2011
Company: 1A Software e.U

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"?

 
#4
People who like this:0Yes/0No
Interested
Rating: 11
Joined: Nov 10, 2011
Company: 1A Software e.U

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"?

 
#5
People who like this:0Yes/0No
Interested
Rating: 11
Joined: Nov 10, 2011
Company: 1A Software e.U

And additional question:

is it necessary to use XDTOFactory?

 
#6
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

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

 
#7
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.