Ler vários arquivos XML e efetuar o Somatório de um determinado nó [fechada]

-<total>


-<ICMSTot>

<vBC>728.96</vBC>

<vICMS>87.48</vICMS>

<vICMSDeson>0.00</vICMSDeson>

<vFCPUFDest>0.00</vFCPUFDest>

<vICMSUFDest>43.74</vICMSUFDest>

<vICMSUFRemet>0.00</vICMSUFRemet>

<vFCP>0.00</vFCP>

<vBCST>0.00</vBCST>

<vST>0.00</vST>

<vFCPST>0.00</vFCPST>

<vFCPSTRet>0.00</vFCPSTRet>

<vProd>728.96</vProd>

<vFrete>0.00</vFrete>

<vSeg>0.00</vSeg>

<vDesc>0.00</vDesc>

<vII>0.00</vII>

<vIPI>0.00</vIPI>

<vIPIDevol>0.00</vIPIDevol>

<vPIS>0.00</vPIS>

<vCOFINS>0.00</vCOFINS>

<vOutro>0.00</vOutro>

<vNF>728.96</vNF>

<vTotTrib>0.00</vTotTrib>

</ICMSTot>

</total>


-<transp>

<modFrete>0</modFrete>


-<vol>

<qVol>1</qVol>

<esp>VOLUMES</esp>

<pesoL>8.800</pesoL>
// Encontrar esse valor e somar com o valor do próximo arquivo xml

<pesoB>8.800</pesoB>

</vol>

</transp>

Quero fazer em JS porque é a linguagem que mais tenho afinidade.

plugins – XML export doesn’t export all data (Elementor Pro)

I’m building a theme with Elementor PRO and I want to make the demo content importable via “One Click Demo Import” plugin when someone uses my theme.

However, when I’m exporting the data from the development server into xml file via Tools -> Export -> All content, not all data from the database is exported into the xml file. E.g. not all records from wp_postmeta table meta_key="_elementor_page_settings" (which store Elemetor’s global Site Colors and Fonts) are present in the xml file. There are ~500 rows in the database, but only ~15 are exported into the XML file. This results in Elementor Site Settings not transferred correctly to other sites.

What may be the reason for not all data being exported or what’s the correct way to configure Elementor export/import for a new theme demo content?

Thanks in advance!

known vulnerabilities – What is an XML round trip vulnerability?

I keep hearing about the XML round trip vulnerability in version 3.2.4 of the Ruby package REXML. I looked into it myself, of course, and it seems to have something to do with parsing an XML document, then putting it back into XML again, and it coming out incorrect or just different than the original.

Presumably, it can be different in dangerous ways.

Is that correct? Can someone link me to resources that explicate this kind of vulnerability, or perhaps help me (and anyone else in the future) understand exactly how this works?

Thanks!

Magento 2 which of the elements automatically render their children in layout Xml?

Which two elements automatically render their children in Xml?

  1. <block class=”MagentoFrameworkViewElementAbstractBlock” name=”shop.info.details”/>
  2. <block class=”MagentoFrameworkViewElementTemplate” name=”shop.info.details”/>
  3. <container name=”shop.info.details”/>
  4. <block class=”MagentoFrameworkViewElementTextListText” name=”shop.info.details”/>

sharepoint online – XML Viewer Web Part

I want to display XML data as HTML in SharePoint Online. I am not able to see the XML viewer web part (under Content Rollup Categories) even after the custom script is enabled using the admin interface. Am I missing something in configuration?

Could you please suggest any pointers or an alternative solution for displaying XML using XSLT?

Please note: I am new to SharePoint Online & SharePoint Ecosystem.

Thank you very much in advance for your support

xml – Critical CSS file position

Is there a way to include inline styles after the <title> tag as shown on this image:

enter image description here

If I edit the file default_head_blocks.xml I can only get this to show after the merged css file which defeats the purpose of using critical-css. One possible way is to add this bit of code into default.xml but then the inline css is rendered right at the top of <head> before all the <meta> tags so I’m not sure if this is bad practice or not

<referenceBlock name="require.js">
       <action method="setTemplate">
           <argument name="template" xsi:type="string">Magento_Theme::/header/inline-css.phtml</argument>
       </action>
</referenceBlock>

Delphi leitura de xml com xmldocument

Tenho um xml com nos com o mesmo nome como faço para ler esses valores ?

        <det nItem="4">
            <prod>
                <cProd>7544</cProd>
                <cEAN>SEM GTIN</cEAN>
                <xProd>ORG CLEAR 37X15X13CM NAT</xProd>
                <NCM>39249000</NCM>
                <CFOP>6202</CFOP>
                <uCom>UN</uCom>
                <qCom>2.00</qCom>
                <vUnCom>18.1400</vUnCom>
                <vProd>36.28</vProd>
                <cEANTrib/>
                <uTrib>UN</uTrib>
                <qTrib>2.00</qTrib>
                <vUnTrib>18.1400</vUnTrib>
                <indTot>1</indTot>
            </prod>
            <imposto>
                <ICMS>
                    <ICMSSN101>
                        <orig>0</orig>
                        <CSOSN>101</CSOSN>
                        <pCredSN>2.75</pCredSN>
                        <vCredICMSSN>1.00</vCredICMSSN>
                    </ICMSSN101>
                </ICMS>
                <IPI>
                    <cEnq>999</cEnq>
                    <IPITrib>
                        <CST>99</CST>
                        <vBC>0.00</vBC>
                        <pIPI>0</pIPI>
                        <vIPI>0.00</vIPI>
                    </IPITrib>
                </IPI>
                <PIS>
                    <PISOutr>
                        <CST>99</CST>
                        <vBC>0.00</vBC>
                        <pPIS>0.00</pPIS>
                        <vPIS>0.00</vPIS>
                    </PISOutr>
                </PIS>
                <COFINS>
                    <COFINSOutr>
                        <CST>99</CST>
                        <vBC>0.00</vBC>
                        <pCOFINS>0.00</pCOFINS>
                        <vCOFINS>0.00</vCOFINS>
                    </COFINSOutr>
                </COFINS>
            </imposto>
        </det>
        <det nItem="5">
            <prod>
                <cProd>7547</cProd>
                <cEAN>SEM GTIN</cEAN>
                <xProd>ORG CLEAR TP 30X15X7CM NAT</xProd>
                <NCM>39249000</NCM>
                <CFOP>6202</CFOP>
                <uCom>UN</uCom>
                <qCom>1.00</qCom>
                <vUnCom>17.2300</vUnCom>
                <vProd>17.23</vProd>
                <cEANTrib/>
                <uTrib>UN</uTrib>
                <qTrib>1.00</qTrib>
                <vUnTrib>17.2300</vUnTrib>
                <indTot>1</indTot>
            </prod>
            <imposto>
                <ICMS>
                    <ICMSSN101>
                        <orig>0</orig>
                        <CSOSN>101</CSOSN>
                        <pCredSN>2.75</pCredSN>
                        <vCredICMSSN>0.47</vCredICMSSN>
                    </ICMSSN101>
                </ICMS>
                <IPI>
                    <cEnq>999</cEnq>
                    <IPITrib>
                        <CST>99</CST>
                        <vBC>0.00</vBC>
                        <pIPI>0</pIPI>
                        <vIPI>0.00</vIPI>
                    </IPITrib>
                </IPI>
                <PIS>
                    <PISOutr>
                        <CST>99</CST>
                        <vBC>0.00</vBC>
                        <pPIS>0.00</pPIS>
                        <vPIS>0.00</vPIS>
                    </PISOutr>
                </PIS>
                <COFINS>
                    <COFINSOutr>
                        <CST>99</CST>
                        <vBC>0.00</vBC>
                        <pCOFINS>0.00</pCOFINS>
                        <vCOFINS>0.00</vCOFINS>
                    </COFINSOutr>
                </COFINS>
            </imposto>
        </det>
        <det nItem="6">

xml – Comprobar que una variable existe JAVA

double estimatedOverallContractAmount

estimatedOverallContractAmount es una primitiva. Hay un espacio de memoria reservado para el valor, el valor siempre existirá (aunque pueda ser 0.0).

if (estimatedOverallContractAmount) {

A diferencia de otros lenguajes (C/C++), if y while espera una expresión booleana. En C te comprobaria si estimatedOverallContractAmount se evalúa a 0 (false) o no (true), en Java estimatedOverallContractAmount debería ser true o false.

El equivalente en Java sería

if (estimatedOverallContractAmount != 0d) {

que es una expresión que es true o false.

En todo caso,

double estimatedOverallContractAmount = Double.parseDouble(estimatedOverallContractAmountNode.getTextContent());

Si aquí estimatedOverallContractAmountNode.getTextContent() devuelve null o la cadena vacía, te saltará una excepción porque no se puede parsear como double (recordemos, es una primitiva, no hay valor null). Este es el valor que tienes que controlar, antes de hacer ninguna conversión.

if ((estimatedOverallContractAmountNode.getTextContent() != null) && !estimatedOverallContractAmountNode.getTextContent().isBlank()) {

asp.net – como extraer un xml de una cadena de texto C#

tengo esta cadena pero quiero sacar el puro XML INCIANDO DESDE :cfdi:Comprobante HASTA : </cfdi:Comprobante> Solo quiero ese fragmento, para guardar las variables que me regresa:

<cfdi:Comprobante xmlns:cfdi=”http://www.sat.gob.mx/cfd/3″ xmlns:bisoft=”http://b1-soft.com/addenda/estandar” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
Certificado=”MIIFyDCCA7CgAwIBAgIUMzAwMDEwMDAwMDA0MDAwMDI0NDMwDQYJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERFIEFETUlOSVNUUkFDSU9OIFRSS
UJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQXV0aG9yaXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYX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AAOCAgE
ACjfTPoKY2N5MxjmAMltd5XZCV1vgAwEtrIRYTodhE8R0Tp1QanAXb0luPyBv5hIXWK4VqAI4fcTtP+n7kkrwfha6ErkPWFNJWJm8ZsMmby/3WgVoJkOFyRYQqr5Il3N6wMa5kiDBtDRbqB3iEXmvtrvjWSHyxAER+zo3
jWGFlhBZ0nQNRtjx8sPFihVc5TUH682HJiU4oWvT63Dnra8ncqiW/uCuY86crnUq0fW7Lw/3+PY5xXjNxR/Hh3sUPITfJrGaLWurD1J9npr9yGAJ6t9zrhhZnepIC0DUMc5+j4pg1DrO32jzwUOLQqErDizh84NoJCW
wbg+US8wi3zD0ZKiDv7XsTNWAW2Ap2JkzykKHjFTZiEm3uZOkJNfcu3o+kefr5HfXFT+iN9K5FUEhaQwgUeZBRJ8V5F6gmhz3d6ixVbiZoFNhYR8e2k8gF9gGrVMrEbJGQrl+6+ZYQLFiauXeG7fu1svk19PuyredRJG
nseJqyV4RzcRGhJA+cLnmpdDOTEhignnvnhEuY6HVRYYXhOTyeeluET7KRCxbJGqO7TdWgjrHL3HRbNE4NY5GAdOZuLaWxElG5ZVCHqtG0Nh7UQAhcz+EKyZBAewv5XuH0OomZXw6mM2mY2soL6z1224NusM8/BbJcYTQ
UlAEKblEChhGK1XlxiVOU2nc9KE=” Fecha=”2021-04-08T00:00:00″ Folio=”8″ LugarExpedicion=”97196″ Moneda=”MXN” NoCertificado=”30001000000400002443″ Sello=”RPdhBiQ3Vi4V4DZa
4tD6JDHMH1DSmeyhTZxq0oeuD9IDQ7KGMsoQNmKRW8zLVqGIgNvDNrq43YlAZ0sEuOLR2DOE3xWOia+9ERGAxK7iwxrusR7XYQcSKWNa65/GTYpzRAE9y84JjRo3LNFCxA20+MoUAptr52ecusR59j+AZOpg0Gw22yu7g
Z5FOGI476jJbobgDHGbShkYtUqhu/qfPnwkitHMNzwDt7do/1bTXkxIG5EnSAZYwzMoubG4LpLWqY4Bn23tiybmDezuqZePAIq6yS1AlrMSMhQRqbw9AP3dXsyqVADpllk0DLK/DK60XmLLSR+8ma1S2pRtsAweLg==”
SubTotal=”0.00″ TipoCambio=”1″ TipoDeComprobante=”T” Total=”0.00″ Version=”3.3″ xsi:schemaLocation=”http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd
http://b1-soft.com/addenda/estandar http://www.b1-soft.com/addenda/estandar/b1estandar.xsd”><cfdi:Emisor Nombre=”IQFRESH TRANSPORT 5″ RegimenFiscal=”601″ Rfc=”XIA190128J61″/>
<cfdi:Receptor Nombre=”Combustibles de Chazumba” Rfc=”AID031212SN4″ UsoCFDI=”G01″/>cfdi:Conceptos<cfdi:Concepto Cantidad=”500″ ClaveProdServ=”10101502″ ClaveUnidad=”31″
Descripcion=”Perros” Importe=”5.00″ Unidad=”Pescar” ValorUnitario=”0.01″/></cfdi:Conceptos>cfdi:Complemento<tfd:TimbreFiscalDigital
xsi:schemaLocation=”http://www.sat.gob.mx/TimbreFiscalDigital http://www.sat.gob.mx/sitio_internet/cfd/timbrefiscaldigital/TimbreFiscalDigitalv11.xsd” Version=”1.1″
UUID=”A66B584C-A666-4ED8-B8E7-026A5FADBBEE” FechaTimbrado=”2021-04-09T18:38:49″ RfcProvCertif=”STB080508AAA” SelloCFD=”RPdhBiQ3Vi4V4DZa4tD6JDHMH1DSmeyhTZxq0oeu
D9IDQ7KGMsoQNmKRW8zLVqGIgNvDNrq43YlAZ0sEuOLR2DOE3xWOia+9ERGAxK7iwxrusR7XYQcSKWNa65/GTYpzRAE9y84JjRo3LNFCxA20+MoUAptr52ecusR59j+AZOpg0Gw22yu7gZ5FOGI476jJbobgDHGb
ShkYtUqhu/qfPnwkitHMNzwDt7do/1bTXkxIG5EnSAZYwzMoubG4LpLWqY4Bn23tiybmDezuqZePAIq6yS1AlrMSMhQRqbw9AP3dXsyqVADpllk0DLK/DK60XmLLSR+8ma1S2pRtsAweLg==” SelloSAT=”CJ9ph
RbdNORIH5iwbTRNij8w94Q60R9jOy4MsXltkBuheT5xyqwrPxQjMBeK5bwCbT0jfl5dDdVH14r0fsSCA+bOMhQ0xKwck1c6x6crzeCIrtaXVN9c1Lm4yGd/C2jJplnOfVy7cmxYQkEshhlxKNksFcRB8eqZX8h8O8
yhQE2NGR5RfHCqgEsvhwxLuOYxPivFFKLIZEBBXn2MpycAROYf6O8a5vNAnAwQqMWRY0DqmW4d/XGKcch+uL0RKweUF+3YjOtNPv3POI08SJMNKPs8QkIT2S3hrAY2dWMB8mXJ5yD1RMhOplJyn+YfIsLTlz7gT5L
jd3DCFWZoVFDe5A==” NoCertificadoSAT=”30001000000400002495″ xmlns:tfd=”http://www.sat.gob.mx/TimbreFiscalDigital” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”/>
</cfdi:Complemento>cfdi:Addendabisoft:Estandarbisoft:ETDUPLI<bisoft:DUPLI IdSucursal=”10073″
NombreDocumento=”cfdi_09042021T183103.xml”/></bisoft:ETDUPLI></bisoft:Estandar></cfdi:Addenda></cfdi:Comprobante>|&acuse|Acuse disponible solo en el ge
stor de documentos|acuse&|AVISO:FIN AVISO>|cfdi_09042021T183103.xml.pdf UTF-8JVBERi0xLj QKJeLjz9MKMSAwIG9iago8PC9Db2xvclNwYWNlL0RldmljZVJHQi9TdWJ0eXBlL0ltYWdlL0hlaWdodCA3OS9GaWx0ZXIvRENURGVjb2RlL1R5cGUvWE9iamVjdC9XaWR0aCAyMTIvQml0c1BlckNvbXB

alguna función para quitar el texto a la derecha después de la etiqueta: </cfdi:Complemento>

plugins – Retrieve and copy an xml data in another item data, the right way?

i’m using WpAllImport plugin to import some xml files in my wordpress.

I have an xml file similar to this

<feed>
  <import1>
    <user1>..userdata..</user1>
    <item>..itemdata..</item>
           ..otheritems..
  </import>
  <import2>
    <user2>..userdata..</user2>
    <item>..itemdata..</item>
           ..otheritems..
  </import>
<feed>

I’m using the code below to retrieve some data from <user> (for example the email) and print them in <item>

function wpai_pmxi_before_xml_import( $importID ) {
// Retrieve import object.
$import = new PMXI_Import_Record();
$import->getById( $importID );

// Ensure import object is valid.
if ( ! $import->isEmpty() ) {

    // Retrieve history file object.
    $history_file = new PMXI_File_Record();
    $history_file->getBy( 'import_id', $importID );

    // Ensure history file object is valid.
    if ( ! $history_file->isEmpty() ) {

        // Retrieve import file path.
        $file_to_import = wp_all_import_get_absolute_path( $history_file->path );

        // Load import file as SimpleXml.
        $file = simplexml_load_file( $file_to_import );
        
        // Check if emailis a child of Procurement.
        $query = $file->xpath( "//feed/import(1)/item(1)/email(1)" );
        if ( ! empty( $query ) ) {

            // If it is, do nothing.
            return;
        }
                                
        // Get email value.        
       $iquery = $file->xpath( "///import/user/email(1)" );
                
        // Ensure value isn't empty.
        if ( ! empty( $iquery ) ) {

            // Value of emailas string.
            $status = $iquery(0)->__toString();

            // Target path.
            $new_query = $file->xpath( "./import/item" );

            // Ensure path is valid.
            if ( ! empty( $new_query ) ) {

                // Process each item element.
                foreach ( $new_query as $record ) {

                    // Ensure this element doesn't have email.
                    if ( ! isset( $record->email ) ) {

                    // Add {email(1)} as child node.
                    $record->addChild( 'email', $status );

                    }
                }

                // Save updated file.
                $updated_file = $file->asXML( $file_to_import );

            }
        }
     }
  }
}

Now, this code prints the <email> data of the first <user> in all <item>, while I should retrieve the <email> of each user and print it in the relative <item> in each <import>

Any suggestions?