1

Topic: Trouble with formation XML

I form file XML, such strange singularity turns out. If in the previous tag there was a prefix <Exch: with a colon or any another with a colon it in all subsequent tags thrusts this prefix, and it is necessary to me without a prefix.

Exch: = Doc. AddChild (' V8Exch:Data ');
//IMPLEMENTATION OF THE GOODS AND SERVICES
Inv: = Exch. AddChild (' DocumentObject. ');
Inv. AddChild (' Ref ');
Inv. ChildValues [' Ref ']: = ADQueryInvoicing. FieldByName (' guid ').AsString;
Inv. AddChild (' DeletionMark ');
Inv. ChildValues [' DeletionMark ']: = ' false ';

And on an output the following turns out:

wrote:

<V8Exch:Data>
<v8Exch:DocumentObject.>
<v8Exch:Ref>0fe8a07c-cd7a-4649-9cc3-ad044d51a927</v8Exch:Ref>
<v8Exch:DeletionMark>false</v8Exch:DeletionMark>

And it is necessary to me:

wrote:

<V8Exch:Data>
<DocumentObject.>
<Ref>0fe8a07c-cd7a-4649-9cc3-ad044d51a927</Ref>
<DeletionMark> false </DeletionMark>

2

Re: Trouble with formation XML

Find property of type NameSpace or NameSpaceURI
And for nested tags  it that they did not inherit it from V8Exch:Data

3

Re: Trouble with formation XML

Arioch wrote:

find property of type NameSpace or NameSpaceURI
And for nested tags  it that they did not inherit it from V8Exch:Data

And it ReadOnly.

4

Re: Trouble with formation XML

Not everywhere
http://docwiki.embarcadero.com/Librarie … t.AddChild
You needed to return to  namespace which at document root

5

Re: Trouble with formation XML

svnvlad wrote:

a prefix <Exch: with a colon or any another with a colon

https://ru.wikipedia.org/wiki/__ (XML)
https://msdn.microsoft.com/en-us/library/aa468565.aspx
By and large these "prefixes" should not hinder.
All of them in correct XML should be displayed on links.
And already under links XML-parsery also should decompose tags "on "
And even if prefixes are not present - that implied URI all the same is, should be

6

Re: Trouble with formation XML

svnvlad wrote:

If in the previous tag there was a prefix <Exch: with a colon or any another with a colon

In a root wrong setting. Record

<V8Exch:Data>

designates that element Data which belongs to a name space with  V8Exch is declared. Itself  name spaces should be declared in this element or any parent in a type

<TagName... xmlns:V8Exch = "...">

Record

<DocumentObject.>

designates that element DocumentObject. belongs to a default namespace. I.e. to such space which in this or any parent element is declared as

<TagName... xmlns = "...">

thus, generally speaking, hinders nothing to appropriate to a default namespace to appropriate a certain prefix. Thus following documents are identical

<Root xmlns = "http://mycompany.com">
<Child/>
</Root>
<my:Root xmlns:my = "http://mycompany.com">
<my:Child/>
</my:Root>
<Root xmlns = "http://mycompany.com" xmlns:my = "http://mycompany.com">
<my:Child/>
</Root>
<my:Root xmlns = "http://mycompany.com" xmlns:my = "http://mycompany.com">
<Child/>
</my:Root>
<Root xmlns = "http://mycompany.com">
<my:Child xmlns:my = "http://mycompany.com"/>
</Root>
<test:Root xmlns:test = "http://mycompany.com">
<test:Child/>
</test:Root>

And following XML differs both from previous and from each other

<my:Root xmlns:my = "http://mycompany.com/test">
<my:Child/>
</my:Root>
<my:Root xmlns:my = "http://mycompany.com">
<Child/>
</my:Root>
<Root xmlns = "http://mycompany.com">
<Child xmlns = "http://mycompany.com/test"/>
</Root>

And now the question - elements in what name spaces to you needs to be generated?

7

Re: Trouble with formation XML

_Vasilisk _;
Here fuller file:

<? xml version = "1.0" encoding = "utf-8"?>
<V8Exch: _ 1CV8DtUD xmlns:V8Exch = "http://www.1c.ru/V8/1CV8DtUD/" xmlns:v8 = "http://v8.1c.ru/data" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
<V8Exch:Data>
<DocumentObject.>
<Ref>0fe8a07c-cd7a-4649-9cc3-ad044d51a927</Ref>
<DeletionMark> false </DeletionMark>
<Date> 2016-12-19T00:00:00 </Date>
<Number> 777 </Number>
<Posted> true </Posted>
<> Services </vidoperatsii>
<>62e53177-aa0b-49f8-8b8e-00c71b747534</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<>false</>
<>00000000-0000-0000-0000-000000000000</>
<>b903c772-88a5-4953-abcf-509dc8530db2</>
<>00000000-0000-0000-0000-000000000000</>
<></>
<>000cb026-7117-11e2-811e-001558466144</>
<>0c56abb3-8d3d-11e1-8c52-001e5848397d</>
<>1</>
<>1</>
<>true</>
<>false</>
<>9a621088-21b7-4c34-9ae3-20d5e1503f5a</>
<>66c8385c-40eb-4f2e-823f-b8b4fe9c5535</>
<>1da0ed0e-20c8-4b2b-aa04-d78f4f6a4aed</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<> </adresdostavki>
<>00000000-0000-0000-0000-000000000000</>
<> 6000 </summadokumenta>
<>00000000-0000-0000-0000-000000000000</>
<Comment> </the comment>
<>false</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<></>
<></>
<></>
<> </doverennostnomer>
<>0001-01-01T00:00:00</>
<></>
<></>
<></>
<> false </dokumentbeznds>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<>00000000-0000-0000-0000-000000000000</>
<> </markaavtomobilja>
<></>
<Driver> </the driver>
<></>
<></>
<></>
<>false</>
<>00000000-0000-0000-0000-000000000000</>
<></>
<>false</>
<>false</>
<The goods/>
<VozvratnajaTara/>
<Services>
<Row>
<>442feee8-a710-11e6-9401-00804819a63f</>
<Content> Cargo handling operations </the maintenance>
<Amount> 3000 </quantity>
<Price> 6000 </the price>
<Total> 6000 </the sum>
<> 0 </stavkands>
<> 0 </summands>
<>cbfac538-cfb6-4fd4-8566-c20f34f9a3b0</>
<Subkonto xsi:type = "CatalogRef." >00000000-0000-0000-0000-000000000000</>
<>886bfd53-5b42-41ef-b90b-d4aa36e7169b</>
<>09ba0282-8ea4-4d9a-bb3c-57f77483347c</>
</Row>
</services>
<> </agentskieuslugi>
<> </zachetavansov>
</DocumentObject.RealizatsijaTovarovUslug>
</V8Exch:Data>
</V8Exch: _ 1CV8DtUD>

8

Re: Trouble with formation XML

Exch: = Doc. AddChild (' V8Exch:Data ', ' http://www.1c.ru/V8/1CV8DtUD/ ');
Inv: = Exch. AddChild (' DocumentObject. ', ");

9

Re: Trouble with formation XML

_Vasilisk _;
It turned out.

10

Re: Trouble with formation XML

More truly even so

Exch: = Doc. AddChild (' Data ', ' http://www.1c.ru/V8/1CV8DtUD/ ');
Inv: = Exch. AddChild (' DocumentObject. ', ");