Examples of XML file downloads in 1C. Figing XML file

Transferring information between databases is one of the tasks of their support and administration. For its effective execution in automated complexes 1C, processing are created. They greatly facilitate the routine work, accelerate the processes of unloading-download information and at the same time implement its correctness. Uploading from 1C in XML allows you to create a file with the contents of any object configuration object, and use it when you need to unload data into identical configuration.

Unloading tools

For exporting information contained in databases, the XML format is mainly used. For 1C, many treatments have been developed (for example, Laug-loadedXML82 EPF), with which it is possible to display and upload data to the file. At the same time, the user must receive a file of a specific structure that allows you to download information stored in it into the native database or transfer it to another place. When creating unloading, follow the following rules:

  • Save the created files until the complete recovery and end of procedures for checking the correctness of the transferred information;
  • If you use the processing as a backup tool, create separate subfolders for copies of data and maintain their accounts for quick search.

Supplied in the 1C user support program, which can be found on the ITS website or disks, is a great tool for exporting and importing information. The computer user can unload both the entire base and its individual objects, while in addition to the export itself, various information verification operations are made to help get rid of critical errors in the data. PREPLE 1C Unloading to XML works in two modes:

  • Unloading. Creates a file containing unloaded objects defined by the user;
  • Loading. It reads the previously exported file and records information in it in the information base.

Processing allows you to control objects to invalid characters, and also includes the function of exporting information with limitations.

Unloading can be used not only when exchanging information between databases 1C. With it, it is possible to ensure the integration of various complexes, for example, 1C and sail system. The universality of XML format allows you to create programs for transferring information for almost any information banks. Uploading and downloading XML data is the most important information sharing tool.

Data unloading process inxml

Consider how to unload out of 1C in XML as usual. After downloading the processing of the unloading pharmaceuticals )XML.EPF and its opening, you must perform the following steps:

  • Select objects for export;
  • Configure the necessary filters, for example, in the period;
  • Determine the location of the file with information on the disk subsystem;
  • Run unloading objects.

It must be remembered that the header part of the unloading file differs from the file format used when unloading by exchange plans.

xml

Loading XML in 1C is made to the database-receiver with a configuration identical to the source. Before you download to 1C XML 1C, you must open processing in the database. Then you need to specify the path to the previously unloaded file and load data by pressing the "Download data" button.

If necessary, flags are activated for downloading data in the exchange mode in a distributed information database and ignoring emerging errors when loading objects.

After that, you need to check the databases and make sure that all items are loaded correctly, so as not to get their loss, for example, if an error occurred in the event handler after loading the object.

When the company constantly enjoys in his work with some software complex, then, of course, the question of its continuous support and administration always arises. There is no way to do with the tasks of exchange, storing and recovering data. Consider how to upload or unload data from 1C in XML format, as this is an important procedure for this topic.

They are built so that during unloading it was possible to get the XML format file in which the data necessary for the client will be recorded. At the same time, simultaneously with the recording, the correctness of the correct entries for critical errors occurs.

Thus, unloading to an XML file (import entries) from one information base and subsequent loading from XML to another - represent the data exchange in XML format between the bases.

Such a procedure, especially with large information arrays, saves a large number of handmade.

Import (received file) can also be used as an archive for recovery in unforeseen situations (with loss or damage).

There are a lot of such processing tools, and they are available on the Internet. Responsibility for their use falls on the shoulders (and head) of the client.

But for official users, a universal handler "Unloading / loading XML data" has been created by the developers.

IMPORTANT. Exports to XML in 1C and further loading in XML from 1C is permissible for identical configurations - otherwise it will occur.

Universal handler

Highlights for the use of a universal developer:

  • Import files to save until the end of transferring records and verify their correctness;
  • When using both backup copies, they should be recorded to sort the search.

It provides two modes in its work: creating a file while saving information and reading / writing - when imports.

In addition, the user can install both when exporting and loading data additional limitations.

Remove records

You can unload data both throughout the database and selectively.

After downloading, installing and opening the handler, the following is followed:


Their selection is produced in the dialog box that opens after launch. To do this, set ticks in the list that displays metadata objects to extract;

  1. The necessary filters are configured (for example, by date);
  2. Selects a place on the disk space;
  3. Operation itself starts.

Pour entries to the receiver

The first step to accept data to the database, you need to open a processing program in it.

After the path to the source file is specified and the procedure settings checkboxes are activated (if necessary), you can run the process to "Download Data" button.

Now you know how to upload or unload data from 1C in XML format to save data and exchange between databases.

- All well-known web pages that also pose an analogue of XML with incredible checks.

Reading / write objects XML, FastInfoset, HTML Expand the reading of a text file in the embedded processing of markup tags.

They are also used for creating creators / write objects (see below) as data sources.

XML 1C files contain text information, that is, text files. Objects ReadXML 1C and RecordXML 1C are "superstructure", which allows you to simplify work with the XML file tags 1c.

Objects readingFastInfoset 1C and recordFastInfoset 1C, readHTML 1C and recordHTML 1C are completely similar to readingXml 1C and recordXML 1C and serve to work in the same way with other formats.

The XML 1C file that was used in the examples

Directory\u003e

Directory\u003e

Text SigningErequisites\u003e
Directory\u003e
Configuration\u003e

Example 1. Read the XML 1C file to the Value Tree ReadXML 1C

// Open the XML 1C file to read by readingXml 1C
File \u003d new readingXML ();
File. Openfile ("D: \\ structural configuration.xml");

// Prepare a tree of values
// Each XML branch may be the name, attributes and value
dzxml \u003d new rivals ();
Dzxml. Solonki. Addly ("Name");
DZXML.Colonki. Addly ("value");
DZXML.Colonki. Addly ("Attributes");

// Since the attributes at the XML string may be somewhat - we will record them in the values \u200b\u200btable
// Each attribute has a name and value
Tatarbuts \u003d new tables ();
Tatarbuts. Cutouts. Addly ("Name");
Tatarbuts. Cuttings. Addly ("value");

// Nessing level will help us understand when you need to add a nested branch, and when you need to return to the level up
Focus \u003d 0;
// Current line - a row of wood, will change with an increase in nesting
Current \u003d uncertain;
// Reading the XML 1C file is not made in line, but by structure, when the file is completed, the reading will return a lie
While file. Up () cycle

// We are interested in three types of nodes - the beginning of the item, the text (element value) and the end of the element (to return to the level up)
If the file. PUBUMUL \u003d TYPUZLYXML.The initialement then

Level binding \u003d focus + 1;

// If this is the first line, then add it to the very top of the tree and save only the name
If the current \u003d is uncertain then
Current \u003d Dzxml. Stand ();
Current. Name \u003d File.
Proceed;
Otherwise
// Invested strings
Current Cutter \u003d Circuit. Straight. Add ();
Current. Name \u003d File. // Save the name

// Does this element XML attributes?
If the file.Gality is the factory ()\u003e 0 then
// If yes - copy the prepared empty table to save attributes
Tatrattuzlauzla \u003d Tatarbuts. Screen ();
// cycle by the number of attributes of this element
For sch \u003d 0 via file.golismAtpitributs () - 1 cycle
// For each attribute we will remember the name and value
Row \u003d tataloguizla. Add ();
String. Either \u003d file. IMATINBUT (SC);
String. Description \u003d File. Relationship (sch);
EndCycle;
// Save the element attribute table to the current string
Of the current. The attributes \u003d tatattuzel;
Ended;
Ended;

Inspecified file.Type \u003d Tipuzlaxml.conelement then
// At the beginning of the element, we increase the level of nesting, at the end of the element, decrease
Level binding \u003d level binding - 1;
// Return the current line to the level up
Of the current \u003d flowing.

Insalite the file.Type \u003d Tipuzlaxml.text then
// If the element has a value - just save it
Current. Essay \u003d File. Relation;

Ended;

EndCycle;

File. Close ();

Example 2. Recording a 1C XML file using an object entryXml 1C

// Create a file entryXml 1c
File \u003d new recordXML ();
File. Openfile ("D: \\ structural configuration .xml", "UTF-8");
File. Recruit iteble element ("configuration");

// In the metadata, we go around all the reference books (for details, see "Working with metadata")
For each reference book from metadata. Praises cycle

// recordedConally element - opens a new [subordinate] branch
File. RecruitmentLelement ("Directory");
// writeitatrite - writes an attribute to open earlier branch
File. recruitment ("name", reference book);
File. Recruit patriot ("Synonym", reference book. Sinonym);

// In the metadata, we go around all the details of the directory
For each details from the reference book. Required cycle




EndCycle;

// In the metadata, we go around all the table parts of the reference book
For each PM from the reference book. Cycle
File. Recruit itelectric element ("" Sound ");
File. recruitment ("Name", PC.IMIA);
File. recorditribut ("Synonym", Tch.Sinonym);

For each requisite from Tch.revisitis cycle
File. Recruit iteble element ("requisite");
File. recruitment ("name", requisite);
File. Recruit patriot ("Synonym", requisite. Sinonym);
File. RecruitCeleaselement ();
EndCycle;

File. RecruitCeleaselement ();
EndCycle;

// RemarkConetsElement - "closes" open earlier with the help of recorded the branch
File. RecruitCeleaselement ();
EndCycle;

File. RecruitCeleaselement ();
File. Close ();

Modes of work

Handling LuggageloadsCaddataXML82 implements 2 operation modes: unloading (creating a download file of the data specified by the user) and downloads (reading the unloading file created by the same-name mode and record the data available in it). Setting the mode is made by selecting in the Mode field.

Before starting a mode or other mode (pressing the Run button), you need to specify the name of the unloading file or by entering it manually in the "File Name" field, or by using this field select button and the standard file selection dialog.

In the download mode, it is possible to edit the use of outcomes when recording registers, which can affect the download speed. "Disable outcome" buttons and "Enable" Available when the "Enable the ability to edit the use of results during data download" and are used to manually manage the utilization mode when downloading data. ** Conditions for the applicability of processing **

Processing can be used only in cases where the information base in which the data is unloaded, and the data in which the data is loaded are homogeneous (configurations are identical, data may vary), or all unloaded objects are almost completely identical in composition and types of details and tabular parts, the properties of the "lead" object of metadata, etc. It should be noted that, due to the limitations, the processing is mainly intended for the exchange between homogeneous IB.

The format of the unloading file is different from the file format created when unloading according to the exchange plan, the header part. To upload data (elements of reference books, registers, etc.) processing, the same XML serialization mechanism is used, which is unloaded by exchange plans, file formats are identical in this part.

Definition of uploading

Processing allows you to carry out both full and partial unloading of the information database data into the file. Setting up the composition of the discharged data is performed in the dialog by setting the flags in the tree column displaying the metadata objects that can be disclosed. An additional column of flags, "if necessary", establishes the need to unload objects of this type "on the link". That is, if the checkbox is only installed in the "if necessary" column, then the data on such an object will not be completely unloaded, but only in the volume that is required to maintain reference integrity in the information base, which will download the unload file.

When you open the form, the processing establishes a sign of unloading on the link to all objects, which guarantees the reference integrity of the unloaded fragment of the information base.

When you click on the "Define Objects Unloaded" button, the processing analyzes, references to which data may be contained in objects that have a sign of full unloading, and automatically fills the flag column indicating the need to unload the link. If the object already has the full unloading flag already has, in which case the unload flaru is not installed.

Possible applications

Using this processing is possible, for example, to create a complete or partial backup of data, making data exchange between information bases, as well as an auxiliary tool when restoring problem information bases.