Skip to main content

Due to requirements of our authorities I have the following  XD definition

 

       XD CATALOGO-XML.

       01 Catalogo identified by "catalogocuentas:Catalogo" namespace is

           "www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas".

          02 XSI-C PIC X(145) identified by "xsi:schemaLocation" is

               attribute count in XSI-C-count.

          02 XMLNS-C PIC X(45) identified by "xmlns:xsi" is

                attribute count in XMLNS-C-count.

        02 Ctas-c identified by "catalogocuentas:Ctas".

          03 CodAgrup identified by "CodAgrup" is attribute. .

            04 CodAgrup-value PIC X(80).

          03 NumCta-c PIC X(100) identified by "NumCta" is attribute.

 

Etc.

---------------------------------------------------------------------------------------------------------------

This DEFINITION produces a good XML file that is accepted by our authorities.

It looks as follows:

<?xml version="1.0" encoding="UTF-8"?>

<catalogocuentas:Catalogo xmlns:catalogocuentas="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas" xsi:schemaLocation="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas CatalogoCuentas_1_1.xsd" xmlns:xsi="www.w3.org/.../XMLSchema-instance" Version="1.1">

    <catalogocuentas:Ctas CodAgrup="100" NumCta="123456" Desc="TEST" SubCtaDe="" Nivel="1" Natur="D"/>

</catalogocuentas:Catalogo>

-------------------------------------------------------------------------------------------

When I omit the prefix “catalogocuentas:”  in my namespace definition for writing the file, our authorities do not accept the file, arguing that the prefix is missing. So I need it writing the file.

 

But if I try to read the just written file with exactly the same  XD  description, nothing is read.

Only if I build a second XD definition  without the prefix “catalogocuentas:”  I can read it.

What must I do to use the same XD definition to DO BOTH, write and read the file with the same XD ?

The same thing happens with other prefixes as for example   “cfdi:”

000156  03 Emisor identified by "cfdi:Emisor" count in Emisor-count.

Thanks for any help.

Rolf

 

Due to requirements of our authorities I have the following  XD definition

 

       XD CATALOGO-XML.

       01 Catalogo identified by "catalogocuentas:Catalogo" namespace is

           "www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas".

          02 XSI-C PIC X(145) identified by "xsi:schemaLocation" is

               attribute count in XSI-C-count.

          02 XMLNS-C PIC X(45) identified by "xmlns:xsi" is

                attribute count in XMLNS-C-count.

        02 Ctas-c identified by "catalogocuentas:Ctas".

          03 CodAgrup identified by "CodAgrup" is attribute. .

            04 CodAgrup-value PIC X(80).

          03 NumCta-c PIC X(100) identified by "NumCta" is attribute.

 

Etc.

---------------------------------------------------------------------------------------------------------------

This DEFINITION produces a good XML file that is accepted by our authorities.

It looks as follows:

<?xml version="1.0" encoding="UTF-8"?>

<catalogocuentas:Catalogo xmlns:catalogocuentas="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas" xsi:schemaLocation="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas CatalogoCuentas_1_1.xsd" xmlns:xsi="www.w3.org/.../XMLSchema-instance" Version="1.1">

    <catalogocuentas:Ctas CodAgrup="100" NumCta="123456" Desc="TEST" SubCtaDe="" Nivel="1" Natur="D"/>

</catalogocuentas:Catalogo>

-------------------------------------------------------------------------------------------

When I omit the prefix “catalogocuentas:”  in my namespace definition for writing the file, our authorities do not accept the file, arguing that the prefix is missing. So I need it writing the file.

 

But if I try to read the just written file with exactly the same  XD  description, nothing is read.

Only if I build a second XD definition  without the prefix “catalogocuentas:”  I can read it.

What must I do to use the same XD definition to DO BOTH, write and read the file with the same XD ?

The same thing happens with other prefixes as for example   “cfdi:”

000156  03 Emisor identified by "cfdi:Emisor" count in Emisor-count.

Thanks for any help.

Rolf

 

Hi Rolf,

I can successfully use several different namespaces in a demo program where I write the file and can immediately read it back. What is the xml-status returned on your read?

Example:

      $set preprocess(prexml) endp
       id division.
       program-id.   writexml.
       environment division.
       input-output section.
       file-control.
           select book-file assign to "bookfile.xml"
                      organization is xml
                      document-type is omitted
                      file status is xml-status.

       data division.
       file section.
       xd book-file.
       78  book-ns value "xml.microfocus.com/book.xsd".
       01  book                identified by "book"
                               namespace is book-ns.
           05  publisher pic x(80) identified by "name"
               namespace is "xml.microfocus.com/publisher.xsd".
           05  b-author identified by "name"
               namespace is "xml.microfocus.com/author.xsd".
               10  author-first identified by "firstname"
                   pic x(80).
               10  author-last  identified by "lastname"
                   pic x(80).
           05  b-title            identified by "title"
               pic x(80).
       working-storage section.
       01 xml-status   pic s9(9) value 0.
       procedure division.
           open output book-file
           display xml-status
           move "just a publisher" to publisher
           move "AuthorFirstname" to author-first
           move "AuthorLastname" to author-last
           move "This is the title" to b-title
           write book
           display xml-status
           close book-file
           initialize book
           open input book-file
           display xml-status
           read book-file
           display xml-status
           close book-file
           stop run.

Due to requirements of our authorities I have the following  XD definition

 

       XD CATALOGO-XML.

       01 Catalogo identified by "catalogocuentas:Catalogo" namespace is

           "www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas".

          02 XSI-C PIC X(145) identified by "xsi:schemaLocation" is

               attribute count in XSI-C-count.

          02 XMLNS-C PIC X(45) identified by "xmlns:xsi" is

                attribute count in XMLNS-C-count.

        02 Ctas-c identified by "catalogocuentas:Ctas".

          03 CodAgrup identified by "CodAgrup" is attribute. .

            04 CodAgrup-value PIC X(80).

          03 NumCta-c PIC X(100) identified by "NumCta" is attribute.

 

Etc.

---------------------------------------------------------------------------------------------------------------

This DEFINITION produces a good XML file that is accepted by our authorities.

It looks as follows:

<?xml version="1.0" encoding="UTF-8"?>

<catalogocuentas:Catalogo xmlns:catalogocuentas="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas" xsi:schemaLocation="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas CatalogoCuentas_1_1.xsd" xmlns:xsi="www.w3.org/.../XMLSchema-instance" Version="1.1">

    <catalogocuentas:Ctas CodAgrup="100" NumCta="123456" Desc="TEST" SubCtaDe="" Nivel="1" Natur="D"/>

</catalogocuentas:Catalogo>

-------------------------------------------------------------------------------------------

When I omit the prefix “catalogocuentas:”  in my namespace definition for writing the file, our authorities do not accept the file, arguing that the prefix is missing. So I need it writing the file.

 

But if I try to read the just written file with exactly the same  XD  description, nothing is read.

Only if I build a second XD definition  without the prefix “catalogocuentas:”  I can read it.

What must I do to use the same XD definition to DO BOTH, write and read the file with the same XD ?

The same thing happens with other prefixes as for example   “cfdi:”

000156  03 Emisor identified by "cfdi:Emisor" count in Emisor-count.

Thanks for any help.

Rolf

 

Due to the fact that my program with the detour I found was working, I did not follow up the problem. Now I have a new project with the same problem and therefore I picked up the case again.
I am sure that your example worked, because, although you used different “identified by” clauses, no one has a prefix. That is the reason why you did not hit the core of the problem. I have to use “cfdi:” “xsi:” “xmlns:” etc. as prefix in the identified. So I have to put e.g.
"xsi:firstname" instead of "firstname"
"cfdi:lastname" instead of "firstname"
"xmlns:title" instead of "xmlns:title"
I suppose Netexpress does not work right when it finds a colon :
Or is there a special clause to allow these prefixes?

Running my program I receive a XML Status of x”00” meaning the READ was executed correctly. But as the record itself has a prefix, “cfdi:Comprobante” due to the colon “cfdi:” does not find any object. The whole record is emty.

Due to requirements of our authorities I have the following  XD definition

 

       XD CATALOGO-XML.

       01 Catalogo identified by "catalogocuentas:Catalogo" namespace is

           "www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas".

          02 XSI-C PIC X(145) identified by "xsi:schemaLocation" is

               attribute count in XSI-C-count.

          02 XMLNS-C PIC X(45) identified by "xmlns:xsi" is

                attribute count in XMLNS-C-count.

        02 Ctas-c identified by "catalogocuentas:Ctas".

          03 CodAgrup identified by "CodAgrup" is attribute. .

            04 CodAgrup-value PIC X(80).

          03 NumCta-c PIC X(100) identified by "NumCta" is attribute.

 

Etc.

---------------------------------------------------------------------------------------------------------------

This DEFINITION produces a good XML file that is accepted by our authorities.

It looks as follows:

<?xml version="1.0" encoding="UTF-8"?>

<catalogocuentas:Catalogo xmlns:catalogocuentas="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas" xsi:schemaLocation="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas CatalogoCuentas_1_1.xsd" xmlns:xsi="www.w3.org/.../XMLSchema-instance" Version="1.1">

    <catalogocuentas:Ctas CodAgrup="100" NumCta="123456" Desc="TEST" SubCtaDe="" Nivel="1" Natur="D"/>

</catalogocuentas:Catalogo>

-------------------------------------------------------------------------------------------

When I omit the prefix “catalogocuentas:”  in my namespace definition for writing the file, our authorities do not accept the file, arguing that the prefix is missing. So I need it writing the file.

 

But if I try to read the just written file with exactly the same  XD  description, nothing is read.

Only if I build a second XD definition  without the prefix “catalogocuentas:”  I can read it.

What must I do to use the same XD definition to DO BOTH, write and read the file with the same XD ?

The same thing happens with other prefixes as for example   “cfdi:”

000156  03 Emisor identified by "cfdi:Emisor" count in Emisor-count.

Thanks for any help.

Rolf

 

Due to the fact that my program with the detour I found was working, I did not follow up the problem. Now I have a new project with the same problem and therefore I picked up the case again.
I am sure that your example worked, because, although you used different “identified by” clauses, no one has a prefix. That is the reason why you did not hit the core of the problem. I have to use “cfdi:” “xsi:” “xmlns:” etc. as prefix in the identified. So I have to put e.g.
"xsi:firstname" instead of "firstname"
"cfdi:lastname" instead of "firstname"
"xmlns:title" instead of "xmlns:title"
I suppose Netexpress does not work right when it finds a colon :
Or is there a special clause to allow these prefixes?

Running my program I receive a XML Status of x”00” meaning the READ was executed correctly. But as the record itself has a prefix, “cfdi:Comprobante” due to the colon “cfdi:” does not find any object. The whole record is emty.

Due to requirements of our authorities I have the following  XD definition

 

       XD CATALOGO-XML.

       01 Catalogo identified by "catalogocuentas:Catalogo" namespace is

           "www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas".

          02 XSI-C PIC X(145) identified by "xsi:schemaLocation" is

               attribute count in XSI-C-count.

          02 XMLNS-C PIC X(45) identified by "xmlns:xsi" is

                attribute count in XMLNS-C-count.

        02 Ctas-c identified by "catalogocuentas:Ctas".

          03 CodAgrup identified by "CodAgrup" is attribute. .

            04 CodAgrup-value PIC X(80).

          03 NumCta-c PIC X(100) identified by "NumCta" is attribute.

 

Etc.

---------------------------------------------------------------------------------------------------------------

This DEFINITION produces a good XML file that is accepted by our authorities.

It looks as follows:

<?xml version="1.0" encoding="UTF-8"?>

<catalogocuentas:Catalogo xmlns:catalogocuentas="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas" xsi:schemaLocation="www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas CatalogoCuentas_1_1.xsd" xmlns:xsi="www.w3.org/.../XMLSchema-instance" Version="1.1">

    <catalogocuentas:Ctas CodAgrup="100" NumCta="123456" Desc="TEST" SubCtaDe="" Nivel="1" Natur="D"/>

</catalogocuentas:Catalogo>

-------------------------------------------------------------------------------------------

When I omit the prefix “catalogocuentas:”  in my namespace definition for writing the file, our authorities do not accept the file, arguing that the prefix is missing. So I need it writing the file.

 

But if I try to read the just written file with exactly the same  XD  description, nothing is read.

Only if I build a second XD definition  without the prefix “catalogocuentas:”  I can read it.

What must I do to use the same XD definition to DO BOTH, write and read the file with the same XD ?

The same thing happens with other prefixes as for example   “cfdi:”

000156  03 Emisor identified by "cfdi:Emisor" count in Emisor-count.

Thanks for any help.

Rolf

 

Due to the fact that my program with the detour I found was working, I did not follow up the problem. Now I have a new project with the same problem and therefore I picked up the case again.
I am sure that your example worked, because, although you used different “identified by” clauses, no one has a prefix. That is the reason why you did not hit the core of the problem. I have to use “cfdi:” “xsi:” “xmlns:” etc. as prefix in the identified. So I have to put e.g.
"xsi:firstname" instead of "firstname"
"cfdi:lastname" instead of "firstname"
"xmlns:title" instead of "xmlns:title"
I suppose Netexpress does not work right when it finds a colon :
Or is there a special clause to allow these prefixes?

Running my program I receive a XML Status of x”00” meaning the READ was executed correctly. But as the record itself has a prefix, “cfdi:Comprobante” due to the colon “cfdi:” does not find any object. The whole record is emty.