1c create an XML file. Formatting an XML file

The transfer of information between databases is one of the tasks of their support and administration. For effective visualization, routines are created in automated 1C complexes. It is important to ease the routine of the robot, speed up the processes of acquisition and acquisition of information and immediately implement control of its correctness. Vivantage from 1C in xml allows you to create a file instead of any object of the configured configuration, and change it, if necessary, to convert the data into an identical configuration.

Tools for creations

To export information that is located in databases, it is important to use the xml format. For 1C, there is a separate processing (for example, Task Vivantage xml82 epf), for which you can output files and capture data. In this case, the user is required to extract the file of the song structure, which allows you to capture the information that is saved in another database, or transfer it to another place. When creating vivantage, follow the following rules:

  • Save created files until the moment continued renewal and completion of procedures for verifying the correctness of the transferred information;
  • At times there is a difference in processing as a tool backup Create copies of data within subfolders and keep a log of their appearance for quick search.

The program for supporting 1C users, as can be found on the website or ITS disks, is a wonderful way to export and import information. Your computer can use both the entire database and other parts of the object, in which, in addition to export, various operations are carried out to verify information, which will help to save critical pardons in the data. Processing 1c vivantage in xml works in two modes:

  • Vivantazhennya. I create a file that contains objects that are being visualized, that are being designated as koristuvach;
  • This function reads the previously exported file and writes the information contained in the new file to the information base.

Processing allows you to check objects for unacceptable characters, and also includes the function of exporting information with boundaries.

Vivantage can be used as part of the exchange of information between 1C databases. With this help you can ensure the integration of various complexes, for example, 1C and the Parus system. The versatility of the XML format allows you to create programs for transferring information from virtually any information bank. Processing and processing data xml is the most important tool for exchanging information.

The process of data vivantagexml

Let's take a look at how Vivantazhiti z 1s in xml emergency mode. After importing the data processing VivantazhenyaDanikhxml.epf and it is necessary to enter the following terms:

  • Select objects for export;
  • Adjust the necessary filters, for example, over time;
  • This means that the file with information is deleted on the disk subsystem;
  • Start upgrading of objects.

It is necessary to remember that the header part of the file format is different from the file format that is changed when revising exchange plans.

xml

Zavantazhennya xml in 1s it is connected to the receiving base with a configuration identical to the receiving base. First of all, you need to open the processing in the base-receiver in 1c xml 1c. Then you need to enter the path to the previously imported file and start importing data by clicking on the “Enter data” button.

If necessary, proportions are activated to import data from the exchange mode in the distribution of the information base and ignore errors that occur when objects are imported.

After this, it is necessary to check the databases and reconfigure to ensure that all the elements of the acquisition are correct, so as not to lose them, for example, as a result in the book after the acquisition of an object.

The organization can operate not only in solutions on the 1C:Enterprise platform, but also in other software systems (Galaktika, Vitrilo, SAP, etc.). Whose fault is the due integration of the two add-ons.

For example, a certain program (called "X") needs to read the list of configuration documents. We won’t talk about the practical benefits of such a task, but let me just say that it’s most convenient and in a universal way such a situation will have a value on the list of documents XML format.

Exchange from this format is universal and can be used by a large number of programs. Let's look at how you can use 1C:Enterprises to display a list of configuration documents in an XML file.

Vivantage in XML

And so let's move on to the main one. We need to traverse the list of document metadata and form a list of XML files. In the following screenshot of the views, the algorithm for forming the XML file is:

Function CreateXML() Export // Determine the name of the time clock file Shlyakh = OtrimatiImTimeFile(); // Initialize the "XML Record" class Record = New RecordXML; // Open the time-clocked file for recording- 8 " ) ; // Write a blank to the XML file Record. WriteStupidXML() ; // Record. WriteCobElement(" DocumentsConfigurations" ) ; // First element // Attribute of the first element with the date the file was formed Record. WriteAttribute("generated", Format(LineDate(), "DF = pprr-MM-ddThh:mm:ss; DLF = DT" ) ) ; // Write the skin element to the configuration document. The text contains the name of the document. For skin Doc 3 Metadani. Documents Cycle Record. WriteCobItem("Document"); Record. WriteText(Doc.Im); Record. WriteEntElement() ; End of the cycle; // Finish writing the first element Record. WriteEntElement() ; Record. Close(); // Close the file // Remove two data from the file and place them in the time clock Dviykov_Dani = New Dviykov_Dani (Ways) ; Addresses = PlaceInHours(DoubleData, New UniqueIdentifier) ​​; Address Turnover; // Rotate the file address to the folder EndFunctions

The skin of the creations element may be completed correctly. After the "Write EndElement()" method is added, the "WriteEdgeElement" method is obligatory, otherwise the structure of the XML file will be incorrect.

The basic template for creating XML files and the following sequence:

// 1. We initialize the "XML Record" class Record = New RecordXML; // 2. Open the time file for recording Record. OpenCritiFile(Way, UTF - 8 " ) ; // 3. Write the blank to the XML file Record. WriteStupidXML() ; // // // 4. ++ Written instead of an XML file Record. WriteCobElement("XMLElement"); Record. WriteEntElement() ; // - Written instead of an XML file // 5. Close the file Record. Close();

In just a few minutes, almost any XML file can be created.

In our creation application, the file is translated into double data and rotated to the place where you click the “Create XML” function. The file may be written to the file system.

The butt of the visualized file could have been seen in the screenshots.

Another supplement

For example, create an add-on in the .NET Framework to demonstrate how an XML file can be read in a third-party program.

The program reads the creation file and displays documents in the following list:

You can try it yourself, the program is available for downloading at the end of the article.

Versatility

The XML format is used in most configurations for exchanging data between applied solutions on the 1C platform: Entrepreneurship. Another way of exchanging, which is often used, is to connect via COM connection. XML allows you to combine the exchange with any additional additions, which deserves to be called universal.

Files for download:

Addendum for reading XML file.

Formatting the XML file.

Working with XML documents is available directly from the installed 1C:Enterprise 8 system.

Possibility:

  • sequentially read and write xml documents:
    • recreate the order taken from the text of the element or the value of the XML attribute, the value is consistent with the assigned type;
    • select a row of values ​​to place in the text of an element or the value of an XML attribute;
    • select the XML data type that matches the type passed as a parameter;
    • check the readability of the value assigned to the type from XML;
    • check the validity of the XML schema during XML reading
    • work on recording values ​​in XML format;
    • rotate the type that corresponds to the XML data type.
  • Define an object access model to data XML documents (Document DOM), which complies with current standards:
    • DOM Level 2;
    • XPath (DOM Level 3);
    • DOM Load and Save (DOM Level 3).
  • vikoristovati object model of XML Schemas (XML Schema);
  • vikorystati canonical XML standard 1.1 (Canonical XML 1.1).

Vikorist external connections and work mechanisms with XML can organize integration with application systems for the formats accepted by these systems. Why bother with XSL conversion mechanisms? For example, for such integration you can use the Microsoft BizTalk server:

Fast Information

The platform provides features for working with XML documents in the Fast Infoset binary format. Fast technology Infoset introduces an alternative syntax for rendering XML data. This will ensure less file usage and more high liquidity processing, lower speed of processing of data recorded in the original XML format. Files recorded in the Fast Infoset format may have the extension .fi or .finf.

— all of the web pages, which are also an analogue of XML without strict verification.

Objects for reading/writing XML, FastInfoset, HTML expand the capabilities of reading a text file by processing markup tags.

The same is true for objects Pobudovuvach DOM/Record DOM (div. distance) as a data source.

XML files 1C revenge text information, then є text files. Objects XML Reader 1C and XML Write 1C is a superstructure that allows you to process the 1C file with XML tags.

Objects ReaderFastInfoset 1C and RecordFastInfoset 1C, ReaderHTML 1C and RecordHTML 1C are completely similar to ReaderXML1S and RecordXML1C and serve to work in the same way with other formats.

XML 1C file, like vikoristovuvavsya in the butts

Dovidnik>

Dovidnik>

Text meaningProperties>
Dovidnik>
Configuration>

Example 1. Reading the XML 1C file onto the tree value for additional help Reading XML 1C

//displays the XML 1C file Reading for help Reading XML 1C
File = New Reader XML();
File.ViewFile("D:\ConfigurationStructure.xml");

//preparing value tree
//XML skin tag can have names, attributes and values
dzXML = New TreeValue();
dzXML.Columns.Addati("Name");
dzXML.Columns.Addati("Value");
dzXML.Columns.Addati("Attributes");

//fragments of attributes in an XML row can be splintered - their value is recorded in the table
//The skin attribute has the same value
tAttributes = New TableValue();
tAttributes.Columns.Add("Name");
tAttributes.Columns.Add("Values");

//The deposit guide will help us figure out when it is necessary to fill the deposit, and when it is necessary to turn up the hill
RivenInvestment = 0;
//flow row - a row of wood, can be changed due to increased input
LineRow = Undefined;
//The reading of the XML 1C file is carried out not in a row, but according to the structure; when the file is completed, the reading is reversed
Pokey File.Read() Loop

// we have three types of nodes - the beginning of the element, the text (the value of the element) and the end of the element (to turn to the top)
Yakscho File.NodeType = XMLNodeType.CobElement

Investment Rate = Investment Rate + 1;

//as this is the first row, then add it to the top of the tree and save only the name
YakschonyRow = Unspecified Todi
LineRow = dXML.Rows.Addati();
CurrentRow.Name = File.Im;
Continue to live;
Otherwise
//Nesting rows
LineRow = LineRow.Row.Add();
CurrentRow.Name = File.Im; //save hiring

//Who's who? XML element attributes?
Yakshto File.Number of Attributes() > 0 Todi
//that's how it is - we copy the prepared empty table to save attributes
tAttributesNode = tAttributes.Copy();
//cycle for the number of attributes of this element
For Account = 0 per File.Number of Attributes()-1 Cycle
//for the skin attribute the name and value are stored
Row = tAttributeNode.Addati();
Row.Im = File.AttributeName(Sch);
Row.Value = File.AttributeValue(Value);
KіnetsCycle;
//save the attribute table of the element in the continuous row
LineRow.Attributes = tAttributesNode;
KinetsYakscho;
KinetsYakscho;

Otherwise File.NodeType = XMLNodeType.EndTodayElement
//on the beginning of the element the level of contribution increases, for example the element is changed
Investment Rate = Investment Rate - 1;
//Turn the production row to the top of the mountain
LineRow = LineRow.Batko;

Otherwise File.NodeType = XMLNodeType.Text Todi
//how the element has meaning - just take care of it
LineRow.Value = File.Value;

KinetsYakscho;

KіnetsCycle;

File.Close();

Example 2. Recording a 1C XML file for an additional object Recording XML 1C

//Creating a file RecordXML 1C
File = New EntryXML();
File.ViewFile("D:\StructureConfiguration.xml", "UTF-8");
File.WriteCobElement("Configuration");

//all browsers look after metadata (report section “Working with metadata”)
Database with Metadata. Database Cycle

//Write an Element to an Element - opens a new [closed] corner
File.WriteCobElement("Dovidnik");
//WriteAttribute - writes the attribute to the previously opened checkbox
File.WriteAttribute("Im'ya", Dovidnik.Im'ya);
File.WriteAttribute("Synonym", Document.Synonym);

//the metadata is followed by all the details of the provider
For skin Requisites from the Adviser.Requisites Cycle




KіnetsCycle;

// all tabular parts of the editor are traversed for metadata
For skin PM with Dovidnik.
File.WriteCobItem("TabularPart");
File.WriteAttribute("Im'ya", PM.Im'ya);
File.WriteAttribute("Synonym", PM.Synonym);

For skin Requisites from PM.Requisites Cycle
File.WriteCobElement("Properties");
File.WriteAttribute("Im", Props.Im);
File.WriteAttribute("Synonym", Props.Synonym);
File.WriteToElement();
KіnetsCycle;

File.WriteToElement();
KіnetsCycle;

//Write the End of the Element - “closes” the previously opened for the additional Write the End of the Element
File.WriteToElement();
KіnetsCycle;

File.WriteToElement();
File.Close();

If business is constantly being exploited by some kind of software complex, then, naturally, the supply of its constant support and administration will always be blamed. In any case, you will need to save and update your data. Let's look at how to capture or vivantize data from 1C in XML format, as it is an important procedure.

It will be done so that when extracted, it will be possible to obtain a file in XML format, which will record the data necessary for the client. In this case, the correctness of the records being transferred is monitored simultaneously with the recording for critical errors.

Thus, importing into an XML file (importing records) from one information base And now there is a connection from XML to another - they represent the exchange of data in XML format between databases.

This procedure, especially with large amounts of information, protects a great deal of manual work.

Import (removal of the file) can be used as well as archives for updating in non-transferable situations (in case of waste or damage).

There are a lot of such processing tools available, and they are available on the Internet. The responsibility for vicarious work lies on the shoulders (and head) of the client.

Also, for official clients, one of the distributors has created a universal compiler “Vivantage/Investment of XML Data”.

IMPORTANT. Export to XML in 1C away from the vantage in XML from 1C is acceptable for identical configurations - otherwise there will be damage.

Universal compiler

Key points for the universal retailer:

  • Save importing files until the transfer of records is completed and their correctness is verified;
  • If backups are deleted, keep track of their appearance to sort the search.

This robot has two modes: creating a file for saving information and reading/writing it when importing.

In addition, the system can be installed both at the time of export and the acquisition of these additional exchanges.

Recordings available

Data can be visualized both for the entire database and selectively - object-by-object.

After downloading, installing and viewing the window, the following steps are completed:


Their selection is made in the dialog box that opens after launch. To do this, check the boxes that display the metadata objects for extraction;

  1. Set up the necessary filters (for example, by date);
  2. Select a location on the disk space;
  3. The operation itself starts.

Uploading records before acceptance

First of all, to receive the data before the receiving base, you need to open the collection program in it.

After you have indicated the path to the file-jar and activated (for use) procedures, you can start the process with the “Enter data” button.

Now you know how to capture and visualize data from 1C in XML format to save data and exchange between databases.