Android Question XMLBUILDER help for sintax "xsi:schemaLocation"

Discussion in 'Android Questions' started by Gnappos, Nov 5, 2018.

  1. Gnappos

    Gnappos Member Licensed User

    Hi everyone, I'm learning to use XMLBUILDER, but I can not seem to know how to create this xml output:

    <?xml version="1.0" encoding="UTF-8"?>
    <p:FatturaElettronica versione="FPR12"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:p="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 http://www.fatturapa.gov.it/export/...chema_del_file_xml_FatturaPA_versione_1.2.xsd">


    I tried these statements but I can not come to a solution
    Dim x As XMLBuilder
    x = x.create( "FatturaElettronica").attribute("xmlns","http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2" ).attribute("versione","FPR12")
    x=x.namespace2("ds", "http://www.w3.org/2000/09/xmldsig#")
    x=x.namespace2("p", "http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2")
    x=x.namespace2("xsi","http://www.w3.org/2001/XMLSchema-instance")
    ' the following instruction gives me error
    x=x.namespace2( "xsi:schemaLocation","http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 http://www.fatturapa.gov.it/export/...chema_del_file_xml_FatturaPA_versione_1.2.xsd")

    Best regard
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is very difficult to read your post.
    Please post it again and use code tags.
     
  3. Gnappos

    Gnappos Member Licensed User

    sorry
    I wont create this xml (header part) output

    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <p:FatturaElettronica versione=
    "FPR12" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:p="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.2/Schema_del_file_xml_FatturaPA_versione_1.2.xsd">
    <FatturaElettronicaHeader>
    this is my b4a code that "comes" to what I want but I think I did not understand how to do it

    Code:
    Dim x As XMLBuilder
    x = x.create( 
    "FatturaElettronica").attribute("xmlns","http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2" ).attribute("versione","FPR12")
    x=x.namespace2(
    "ds""http://www.w3.org/2000/09/xmldsig#")
    x=x.namespace2(
    "p""http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2")
    x=x.namespace2(
    "xsi","http://www.w3.org/2001/XMLSchema-instance")
    ' the following instruction gives me error
    x=x.namespace2( "xsi:schemaLocation","http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 http://www.fatturapa.gov.it/export/...chema_del_file_xml_FatturaPA_versione_1.2.xsd")
    I have to check, but this seems to give an output equivalent to the expected one

    Code:
    Dim x As XMLBuilder
      x = x.create( 
    "FatturaElettronica").attribute("xmlns:ds","http://www.w3.org/2000/09/xmldsig#").attribute("xmlns:p","http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2").attribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance" ).attribute("xsi:schemaLocation","http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.2/Schema_del_file_xml_FatturaPA_versione_1.2.xsd")
     
    Last edited: Nov 6, 2018
  4. Erel

    Erel Administrator Staff Member Licensed User

    Tested here and it indeed produces the same header.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice