Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all 935 articles
Browse latest View live

Memory leak on MSXML6 transform

$
0
0

Hi everyone,

I am trying to resolve the following issue. There seems to be a huge leak when running a transform using a specific version of msxml6. A quite big piece of xml (~140mb of unicode xml string) needs to be transformed. When running this piece of code:

// Create processor and check created ok
::IXSLProcessorPtr pIXSLProcessor = m_pIXSLTemplate->createProcessor();

if (pIXSLProcessor != NULL)
{
    // Variant for source XML document
    VARIANT varSourceDoc;

    // Set XSLT processor source document location
    varSourceDoc.vt       = VT_DISPATCH;
    varSourceDoc.pdispVal = rxmlSource.GetXmlDocument();

    // Set the source XML document and check it is ok
    if (S_OK == pIXSLProcessor->put_input(varSourceDoc))
    {
        // Set the result stream and check it is ok
        if (S_OK == pIXSLProcessor->put_output(_variant_t(&rxmlStream.GetStreamObject())))
        {
            // Transform the documentVARIANT_BOOL varStatus = pIXSLProcessor->transform();

            // Check transform ok
            if (varStatus == VARIANT_TRUE)

            // Set the return flag
            fXslSetOk = true;
        }
    }
}

the pIXSLProcessor->transform() is hit, and then theraw_transform function is called, in msxm6.tli, which does this:

inline VARIANT_BOOL IXSLProcessor::transform ( ) {
    VARIANT_BOOL _result = 0;
    HRESULT _hr = raw_transform(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

After the moment raw_transform is hit, memory starts growing very fast, starting from 200mb for that process, to 1gb, then 2gb, then 4gb, and then it hangs my whole system and I need to reset. 

I am using Windows 8 (64bit). This issue occurs only with the following version of msxml6.dll:
Product name: Microsoft XML Core Services
Product version: 6.30.9200

I have found other versions from other windows installations, and the transform works fine for one of them, after I copied them over temporarily in C:/Windows/System32. The other versions I tried are:

WORKS:

Product name: Microsoft(R) MSXML 6.0 SP3
Product version: 6.30.7601
Taken from: Windows 7

and

DOES NOT WORK:

Product name: Microsoft XML Core Services
Product version: 6.30.9600
Taken from: Windows 8.1

Since this only happens on these two versions, could it be a bug?

I have tried updating my msxml6, but it's quite hard to find the version I need online. Presumably this https://www.microsoft.com/en-gb/download/details.aspx?id=6276 would be it (although it mentions version 6.10.1129.0, and it's only SP1, not SP3), but install does not seem to update my msxml6.dll.

I have spent a lot of time on this, any help would be appreciated.

Regards,

Stathis



Getting data connection details

$
0
0

I have a .NET SOAP WebService that is retrieving data from an old dataset.

 

With database connections you setup the database connection, database name, tables, etc.

The .NET projects only lists the AddressSearch and Web.Services.

  • I do not see any reference to the database/Tables, Locator, csv, etc???

 

 

AddressSearch.cs lists

[System.Web.Services.WebServiceBindingAttribute(Name="AddressSearchSoap", Namespace="http://webservices.localgov.gov.uk/nlpgv1webservice")]

 

I cannot find the database or data file reference in the ASPX project???

 

I would appreciate any assistance in resolving this issue.

 

Thanks,

 

Clive


Clive

SignedXml.Checksignature returns false

$
0
0

Trying this with .NetFramework 4.0.

I am working on implementatio of SSO using SAML for security. My code need to work as a Identity Service Provider where I need to validate a SAML Assertion generated from customer's Federation Server and sent to my web-site. As of now everything was good till I received a SAML Assertion with SHA1 algoritm but when it starts sending SHA256, the nighemare started. :)

Well, I have read a lot around this and implemented provided suggestions but could not get through it yet. I have two ways to validate

1. With only SAML Assertion his my site

2. With the certificate (.cer) file provided by my client and situated locally with me.

Below is the code I am using to validate the SAML for point 1. I would go to Point 2 once this is resolved. :)

RSAPKCS1SHA256SignatureDescription.Register();

XmlNamespaceManager nsm = new XmlNamespaceManager(new NameTable());
                nsm.AddNamespace("dsig", SignedXml.XmlDsigNamespaceUrl);
                XmlElement sigElt = (XmlElement)m_xmlDoc.SelectSingleNode("//dsig:Signature", nsm);

                // Load the signature for verification
                SignedXml sig = new SignedXml(m_xmlDoc);
                sig.LoadXml(sigElt);
                if (!sig.CheckSignature())
                    return "Invalid Signature";

As .Net Framework 4.0 does not support SHA256, I have create extension class (public class RSAPKCS1SHA256SignatureDescription : SignatureDescription) as mentioned here. But was of no help. When I debug and try to execute CheckSignature method, the debugger runs me through this new class, but still I get the result as 'False'

Thank you in advance for any help. :)

Regards

Sadneep


"An investment in knowledge pays the best interest." - Ben Franklin



High memory usage on MSXML6 transform, causes whole system to freeze

$
0
0

Hi everyone,

I am trying to resolve the following issue. There seems to be a huge leak when running a transform using a specific version of msxml6. A quite big piece of xml (~140mb of unicode xml string) needs to be transformed. When running this piece of code:

// Create processor and check created ok
::IXSLProcessorPtr pIXSLProcessor = m_pIXSLTemplate->createProcessor();

if (pIXSLProcessor != NULL)
{
    // Variant for source XML document
    VARIANT varSourceDoc;

    // Set XSLT processor source document location
    varSourceDoc.vt       = VT_DISPATCH;
    varSourceDoc.pdispVal = rxmlSource.GetXmlDocument();

    // Set the source XML document and check it is ok
    if (S_OK == pIXSLProcessor->put_input(varSourceDoc))
    {
        // Set the result stream and check it is ok
        if (S_OK == pIXSLProcessor->put_output(_variant_t(&rxmlStream.GetStreamObject())))
        {
            // Transform the documentVARIANT_BOOL varStatus = pIXSLProcessor->transform();

            // Check transform ok
            if (varStatus == VARIANT_TRUE)

            // Set the return flag
            fXslSetOk = true;
        }
    }
}

the pIXSLProcessor->transform() is hit, and then theraw_transform function is called, in msxm6.tli, which does this:

inline VARIANT_BOOL IXSLProcessor::transform ( ) {
    VARIANT_BOOL _result = 0;
    HRESULT _hr = raw_transform(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

After the moment raw_transform is hit, memory starts growing very fast, starting from 200mb for that process, to 1gb, then 2gb, then 4gb, and then it hangs my whole system and I need to reset. 

I am using Windows 8 (64bit). This issue occurs only with the following version of msxml6.dll:
Product name: Microsoft XML Core Services
Product version: 6.30.9200

I have found other versions from other windows installations, and the transform works fine for one of them, after I copied them over temporarily in C:/Windows/System32. The other versions I tried are:

WORKS:

Product name: Microsoft(R) MSXML 6.0 SP3
Product version: 6.30.7601
Taken from: Windows 7

and

DOES NOT WORK:

Product name: Microsoft XML Core Services
Product version: 6.30.9600
Taken from: Windows 8.1

Since this only happens on these two versions, could it be a bug?

I have tried updating my msxml6, but it's quite hard to find the version I need online. Presumably this https://www.microsoft.com/en-gb/download/details.aspx?id=6276 would be it (although it mentions version 6.10.1129.0, and it's only SP1, not SP3), but install does not seem to update my msxml6.dll.

I have spent a lot of time on this, any help would be appreciated.

Regards,

Stathis




msxml sp2 parser and sdk error

$
0
0

I keep getting an error from this program. I am not sure what it is for, but it won't allow me to repair it in the programs.  I am not a developer, so I am not sure what this is used for and why It keeps popping up.  I am on windows 8.1

Any help is greatly appreciated.

Read xml nodes

$
0
0

Hello, i have a form that reads xml data and everything is woring but i'm not sure how to get the data from a child node. here is my code.

this function is called when a file is selected

    Private Sub ReadSingleFile()
        Try
            Dim xmlDoc As New XmlDocument()
            xmlDoc.LoadXml(_newFileInfo.FFprobeStandardOutput)
            Dim nodeList As XmlNodeList = xmlDoc.GetElementsByTagName("stream")
            MediaTags.AudioTrackCount = 0
            For Each elem As XmlNode In nodeList
                Dim indexNode As XmlNode = elem.Attributes("index")
                Dim codecTypeNode As XmlNode = elem.Attributes("codec_type")
                Dim codecNameNode As XmlNode = elem.Attributes("codec_name")
                Dim profileNode As XmlNode = elem.Attributes("profile")
                Dim widthNode As XmlNode = elem.Attributes("width")
                Dim heightNode As XmlNode = elem.Attributes("height")
                Dim sampleRateNode As XmlNode = elem.Attributes("sample_rate")
                Dim channelsNode As XmlNode = elem.Attributes("channel_layout")

                Dim track As Integer
                Dim trackType = ""
                Dim trackCodec = ""
                Dim profile = ""
                Dim resolution = ""
                Dim sampleRate = ""
                Dim channels = ""

                If indexNode IsNot Nothing Then
                    track = Convert.ToInt32(indexNode.Value)
                End If
                If codecTypeNode IsNot Nothing Then
                    trackType = codecTypeNode.Value
                End If
                If codecNameNode IsNot Nothing Then
                    trackCodec = codecNameNode.Value
                End If
                If profileNode IsNot Nothing Then
                    profile = " (" & profileNode.Value & "),"
                End If
                If widthNode IsNot Nothing And heightNode IsNot Nothing Then
                    resolution = " " & widthNode.Value & "x" & heightNode.Value
                End If
                If sampleRateNode IsNot Nothing Then
                    sampleRate = " " & sampleRateNode.Value & " Hz,"
                End If
                If channelsNode IsNot Nothing Then
                    channels = channelsNode.Value
                End If

                If trackType = "video" Then
                    MediaTags.VideoTrackID() = track
                    MediaTags.VideoCodec = trackCodec
                    lbStreams.Items.Add("Track " & track & ": " & FirstCharToUpper(trackType) & ": " & trackCodec & profile & resolution)
                ElseIf trackType = "audio" Then
                    MediaTags.AudioTrackID = track
                    MediaTags.AudioCodec = trackCodec
                    lbStreams.Items.Add("Track " & track & ": " & FirstCharToUpper(trackType) & ": " & trackCodec & profile & sampleRate & " " & channels)
                ElseIf trackType = "subtitle" Then
                    lbStreams.Items.Add("Track " & track & ": " & FirstCharToUpper(trackType) & ": " & AllCharToUpper(trackCodec))
                End If
            Next elem
        Catch ex As Exception
            If My.MySettings.Default.WriteErrorLogFiles Then
                Try
                    Dim errorWriter As New StreamWriter(My.MySettings.Default.LogPath & "\error_log.txt", True)
                    errorWriter.WriteLine("An error has occurred while reading file tracks info in function ReadSingleFile")
                    errorWriter.WriteLine(ex.Message)
                    errorWriter.WriteLine(ex.ToString)
                    errorWriter.Flush()
                    errorWriter.Close()
                    errorWriter.Dispose()
                Catch ex1 As Exception
                    MessageBox.Show(ex1.Message)
                End Try
            End If
        End Try
    End Sub

here is my xml data

<streams><stream
          index="0"
          codec_name="h264"
          profile="Main"
          codec_type="video"
          width="720"
          height="404"><disposition
              default="1"
              dub="0"
              original="0"/><tag key="creation_time" value="2014-12-03 17:15:35"/><tag key="language" value="und"/><tag key="encoder" value="JVT/AVC Coding"/></stream><stream
          index="1"
          codec_name="aac"
          profile="LC"
          codec_type="audio"
          sample_rate="48000"
          channels="6"
          channel_layout="5.1"><disposition
              default="1"
              dub="0"
              original="0"/><tag key="creation_time" value="2014-12-03 17:15:35"/><tag key="language" value="eng"/></stream><stream
          index="2"
          codec_name="mov_text"
          codec_type="subtitle"><disposition
              default="1"
              dub="0"
              original="0"/><tag key="creation_time" value="2014-12-03 17:15:35"/><tag key="language" value="und"/></stream></streams>

As you can see this is for media files and I'm trying to get the language from each track whick is layed out a little funny but thats how ffprobe outputs it. any help would be great, thanks

Using ASP.NET to call a web service which requires client side certificate for authentication

$
0
0

Hi,

I have a web service which requires client end certificate authentication. I've installed the cert (pfx format) successfully. I then used IE to launch the URL and it prompted me for certificate, which once selected it can go through and the expected XML response will be shown in the browser.

However, when I use below code to submit the web service call, the response from the server shows: API client certificate not provided or not valid, which should not be the case, since it works through the browser.

Appreciate your help!

Thanks

<%@ Language="VBScript" Debug="true" %>

<%

Dim fso, Output, oHttp, strResult, strSoapReq

fso = CreateObject("Scripting.Filesystemobject")

strSoapReq = fso.OpenTextFile("D:\registration.txt").ReadAll

oHttp = CreateObject("Msxml2.ServerXMLHTTP.6.0")

oHttp.open ("POST", "<url>")

ohttp.setRequestHeader ("Content-Type", "application/json")

ohttp.setOption (3, "<certificate>")

oHttp.send (strSoapReq)

strResult = oHttp.responseText

Output = fso.OpenTextFile("D:\Output.txt", 8, 1)

Output.writeline (strResult)

Output.close

%>

AppBox ID.xml file failed to load and UI language registration list is invalid?


deserialize using class base

$
0
0

hello guys need some help regarding deserialization of xml using class and xmlserialize.deserialize without using linq

<Person><Name>Emmanuel</Name><Age>24</Age><BasicDetails Gender="Male"><Mobile>09435188068</Mobile><Address><Address1>1769 Ford St</Address1><Address2>Culdesac Sunvalley</Address2><City>Parañaque</City></Address></BasicDetails></Person>

and my class is

[XmlRoot("Person")]
    public class Person
    {
        /// <remarks/>
        public string Name { get; set; }

        /// <remarks/>
        public int Age { get; set; }

        /// <remarks/>
        public List<BasicDetails> BasicDetails { get; set; }
    }
    [XmlRoot("BasicDetails")]
    public class BasicDetails
    {
        /// <remarks/>
        public int Mobile { get; set; }

        /// <remarks/>
        public List<Address> Address { get; set; }

        /// <remarks/>
        [XmlAttribute("Gender")]
        public string Gender { get; set; }
    }
    [XmlRoot("Address")]
    public class Address
    {
        /// <remarks/>
        public string Address1 { get; set; }

        /// <remarks/>
        public string Address2 { get; set; }

        /// <remarks/>
        public string City { get; set; }
    }

i can only pull the data via xml root but on the nested node i cannot make it

thanks and godbless in advance


auwi

To remove name space xmlns

$
0
0

Hi,

After transformation, my xml document looks like this.

<WriteEBSReqMsg>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="data">

<EnterpriseDocument xmlns="http://foo.bat"

<!-- LinesOfCode !-->

</EnterpriseDocument>

</part>

</WriteEBSReqMsg>

I am trying to remove xmlns="http://foo.bat" from my transformed XML output, but unable to do so.

Is there any way i can get this done. 

Thanks in advance for the help.

Search XML Document with multiple matches

$
0
0

Hi

I have to search an XMLDoucment,

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

    <cricketers>

        <cricketer type="lefty">

            <name>Shikhar Dhawan</name>

            <role>Batsman</role>

            <position>Point</position>

        </cricketer>

        <cricketer type="righty">

            <name>Virat Kohli</name>

            <role>Batsman</role>

            <position>cover</position>

        </cricketer>

        <cricketer type="righty">

            <name>Shami</name>

            <role>Bowler</role>

            <position>SquareLeg</position>

        </cricketer>

        <cricketer type="lefty">

            <name>Zaheer Khan</name>

            <role>Bowler</role>

            <position>FineLeg</position>

        </cricketer>

    </cricketers>

I would like to select all the cricketer nodes, where the name contains 'an' or 'mi'

Can you help me on this?

Thanks

Tutu

Unable to debug xsl in Visual Studio 2015RC Community

$
0
0

Hope someone can help,

The options to either debug/start/stop an xsl file are greyed out in the xml editor toolbar - I was following this approach Walkthrough: Debug an XSLT Style Sheet. This works fine in vs2013 community.

Update - also the xml menu only contains Create Schema (greyed out) and Schemas...

Is this a known issue in vs2015RC?

Edit - just reinstalled VS and the problem still persists. Anyone else seeing this issue?

Thank you



Screen Resolution for a Menu

$
0
0

I have the following code for a Menu and if the site is open in screen with a different screen resolution the Menu doesn't adapt to the screen resolution because the padding is defined in pixels.

How could I do to define in % or any other way to have my menu adapting to the screen resolution?

Thank you very much

<Module><ModulePrefs /><Content type="html"><![CDATA[<!DOCTYPE html><base target="_parent"><style type="text/css">
body {margin:0; padding:0; margin-
table {border-collapse:collapse;}
table, td {padding:0; border:1px solid #094FA4;}
a {display:block; background-color:#094FA4; padding:18px 25px; text-decoration:none; outline:none;}
a:hover, a:focus {background-color:#063062;}</style><table><tr><td><a href=""><font color="white">Home</font></a></td><td><a href=""><font color="white">Section1</font></a></td></tr></table>


]]></Content></Module>

Trouble with ms:type-is Example

$
0
0

I am trying to use the Microsoft XPath extension function: type-is. The documentation for this function is available here:https://msdn.microsoft.com/en-us/library/ms256457(v=vs.110).aspx and this page contains an example.

When I copy/paste the example code from the webpage and attempt to use it in the Visual Studio xslt processor, I receive the following error:

XslTransformException
---------------------
Cannot find a script or an extension object associated with namespace 'urn:schemas-microsoft-com:xslt'.

I am using Visual Studio 2013. It seems the type-is function does not work as expected.

I receive the same error, in the form of a System.Xml.Xsl.XslTransformException, when I call the Transform() method of a XslCompiledTransform in a simple console application.

Is there something wrong with the example, or something I may have easily overlooked?


Xmldsig validation question

$
0
0

I have a xml signature that needs to be validated. It has the following SignatureInfo:

<SignedInfo><CanonicalizationMethodAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/><SignatureMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ReferenceURI="#id25a415d3-0a11-11e1-8266-00016c9cc847"Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties"><Transforms><TransformAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/></Transforms><DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>zaDeegM89/0QicIjiiBKKjCs3oA=</DigestValue></Reference><Reference URI=""><Transforms><TransformAlgorithm="http://www.w3.org/2002/06/xmldsig-filter2"><XPathFilter="intersect"xmlns="http://www.w3.org/2002/06/xmldsig-filter2"xmlns:a="http://e-porezna.porezna-uprava.hr/sheme/zahtjevi/ObrazacTZ/v1-1"xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">here()/ancestor::dsig:Signature[1]/../../a:ObrazacTZ[1]//. | here()/ancestor::dsig:Signature[1]/../../a:ObrazacTZ[1]//@* | here()/ancestor::dsig:Signature[1]/../../a:ObrazacTZ[1]//namespace::*</XPath></Transform><TransformAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/></Transforms><DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>oSUPjbPFV8PyhQN/Sp3k2LHgd8o=</DigestValue></Reference></SignedInfo><br/><br/><br/>


Can this be validated in .NET 2.0 (or higher)?

It seems that "xml-exc-c14n#WithComments" and "http://www.w3.org/2002/06/xmldsig-filter2" transforms are not supported.

If they are, how can I do the validation? 

If not, are there any external tools, classes etc. ?

Any help appreciated.

 


SignXML.LoadXML failes with unknown transformation

$
0
0

I am working with VS 2010 / .NET 4 to implement a simple XMLdSig verification. The signature is created by a webservice provider and out of my control. As far as I could examine, the structure of the signature is valid. Hours of googling gave my the impression that xmlenc#256 may be a problem, but before that I even cannot load the XML document.

Can anyone help and tell me whats going wrong resp. where/how to find a solution?

Here is my code snippet:

DialogResult rc = oFDXML.ShowDialog();if (rc!=DialogResult.OK)

{

return;

}



XmlDocument xdoc = new XmlDocument();

xdoc.PreserveWhitespace = true;

xdoc.Load(oFDXML.FileName);

XmlNamespaceManager ebMgr = new XmlNamespaceManager(xdoc.NameTable);string PrefixURLeb = http://www.ebinterface.at/schema/3p0/;string PrefixURLsig = http://www.w3.org/2000/09/xmldsig#;

ebMgr.AddNamespace("eb", PrefixURLeb);

ebMgr.AddNamespace("dsig", PrefixURLsig);

SignedXml sXdoc = new SignedXml(xdoc);

XmlNodeList nodelist = xdoc.GetElementsByTagName("dsig:Signature");

sXdoc.LoadXml((XmlElement)nodelist.Item(0));

if (sXdoc.CheckSignature())

{

 MessageBox.Show("Signature OK");

}

else

{

MessageBox.Show("Signature not OK");

}



Here is the XML File:

<?xmlversion="1.0"encoding="UTF-8"standalone="no"?><eb:Invoicexmlns:eb="http://www.ebinterface.at/schema/3p0/"eb:DocumentTitle="Beispiel-Rechnung"eb:DocumentType="Invoice"eb:GeneratingSystem="ebInterface 3.0 Word Formular Vorlage Version 2.0.0 RC2 SVN Rev:149"eb:InvoiceCurrency="EUR"eb:Language="ger"xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.ebinterface.at/schema/3p0/ http://www.ebinterface.at/schema/3p0/Invoice.xsd"><dsig:SignatureId="signature-1-1"xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethodAlgorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><dsig:SignatureMethodAlgorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/><dsig:ReferenceId="reference-1-1" URI=""><dsig:Transforms><dsig:TransformAlgorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></dsig:Transforms><dsig:DigestMethodAlgorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><dsig:DigestValue>RJc1W6Us9foLWNdOAbOud69orIFo+lOq6TpWN/Pqk94=</dsig:DigestValue></dsig:Reference><dsig:ReferenceId="etsi-data-reference-1-1"Type="http://uri.etsi.org/01903/v1.1.1#SignedProperties" URI=""><dsig:Transforms><dsig:TransformAlgorithm="http://www.w3.org/2002/06/xmldsig-filter2"><xpf:XPathFilter="intersect"xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#"xmlns:xpf="http://www.w3.org/2002/06/xmldsig-filter2">//*[@Id='etsi-signed-1-1']/etsi:QualifyingProperties/etsi:SignedProperties</xpf:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethodAlgorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><dsig:DigestValue>JKUoHDJjvrkPxk2Scd81nNzn6tE2ThyKF56Z7oMXIMs=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>SsdpxgvP74sXBW2f3yKJbkTBdsVTwHzc1R3CE7iQoUzmwkzXymCkV3Su/qUZqQh57nEJ4LovN2iCiQ/7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X8mcOSCZGs6wKyMZxRiQx8tHcEVwRELBqqvzF2AI3VKVpKM2UthZmEG5HSRcABefdmiMGbgRdbsApwYMdIzZqrO/mwcEx2PEXt3Mwm6mgEZIcIqsMmRQv/MyPWMb2AN+MF28=</dsig:X509Certificate></dsig:X509Data></dsig:KeyInfo><dsig:ObjectId="etsi-signed-1-1"><etsi:QualifyingPropertiesTarget="#signature-1-1"xmlns:etsi="http://uri.etsi.org/01903/v1.1.1#"><etsi:SignedProperties><etsi:SignedSignatureProperties><etsi:SigningTime>2011-01-20T14:04:29Z</etsi:SigningTime><etsi:SigningCertificate><etsi:Cert><etsi:CertDigest><etsi:DigestMethodAlgorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><etsi:DigestValue>wP7ZNWqi88yJSGzB9QL//0S+ajc=</etsi:DigestValue></etsi:CertDigest><etsi:IssuerSerial><dsig:X509IssuerName>CN=a-sign-Premium-Test-Sig-02,OU=a-sign-Premium-Test-Sig-02,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT</dsig:X509IssuerName><dsig:X509SerialNumber>151209</dsig:X509SerialNumber></etsi:IssuerSerial></etsi:Cert></etsi:SigningCertificate><etsi:SignaturePolicyIdentifier><etsi:SignaturePolicyImplied/></etsi:SignaturePolicyIdentifier></etsi:SignedSignatureProperties><etsi:SignedDataObjectProperties><etsi:DataObjectFormatObjectReference="#reference-1-1"><etsi:MimeType>text/xml</etsi:MimeType></etsi:DataObjectFormat></etsi:SignedDataObjectProperties></etsi:SignedProperties></etsi:QualifyingProperties></dsig:Object></dsig:Signature><eb:InvoiceNumber>20110001</eb:InvoiceNumber><eb:InvoiceDate>2011-01-13</eb:InvoiceDate><eb:Delivery><eb:Date>2011-01-13</eb:Date></eb:Delivery><eb:Biller><eb:VATIdentificationNumber>ATU123456</eb:VATIdentificationNumber><eb:Address><eb:Name>Bogad &amp; Partner Consulting OG</eb:Name><eb:Street>Steinbachstrasse 17</eb:Street><eb:Town>Mauerbach</eb:Town><eb:ZIP>3001</eb:ZIP><eb:Country>AT </eb:Country></eb:Address></eb:Biller><eb:InvoiceRecipient><eb:VATIdentificationNumber>00000000</eb:VATIdentificationNumber><eb:BillersInvoiceRecipientID>111111</eb:BillersInvoiceRecipientID><eb:OrderReference><eb:OrderID>444444</eb:OrderID><eb:ReferenceDate>2010-12-01</eb:ReferenceDate></eb:OrderReference><eb:Address><eb:Name>BRZ</eb:Name><eb:Street>Hintere Zollamtsstrasse 4</eb:Street><eb:Town>Wien</eb:Town><eb:ZIP>1030</eb:ZIP><eb:Country>AT </eb:Country></eb:Address></eb:InvoiceRecipient><eb:Details><eb:HeaderDescription>Wir erlauben uns wie folgt zu verrechnen.</eb:HeaderDescription><eb:ItemList><eb:ListLineItem><eb:PositionNumber>1</eb:PositionNumber><eb:Description>Tagsatz</eb:Description><eb:BillersArticleNumber>0000</eb:BillersArticleNumber><eb:Quantityeb:Unit="Tag">5.00</eb:Quantity><eb:UnitPrice>970.00</eb:UnitPrice><eb:TaxRate>20.00</eb:TaxRate><eb:DiscountFlag>false</eb:DiscountFlag><eb:ReductionRate>0.00</eb:ReductionRate><eb:LineItemAmount>4850.00</eb:LineItemAmount></eb:ListLineItem></eb:ItemList><eb:FooterDescription>Wir danken für Ihren Auftrag.</eb:FooterDescription></eb:Details><eb:Tax><eb:VAT><eb:Item><eb:TaxedAmount>4850.00</eb:TaxedAmount><eb:TaxRate>20.00</eb:TaxRate><eb:Amount>970.00</eb:Amount></eb:Item></eb:VAT></eb:Tax><eb:TotalGrossAmount>5820.00</eb:TotalGrossAmount><eb:PaymentMethodeb:ConsolidatorPayable="false"xsi:type="eb:UniversalBankTransactionType"><eb:BeneficiaryAccount><eb:BankName>Volksbank Wien</eb:BankName><eb:BankCodeeb:BankCodeType="AT">43000</eb:BankCode><eb:BankAccountNr>1234567890</eb:BankAccountNr><eb:IBAN>1234567890</eb:IBAN><eb:BankAccountOwner>Bogad &amp; Partner Consulting OG</eb:BankAccountOwner></eb:BeneficiaryAccount></eb:PaymentMethod><eb:PaymentConditions><eb:DueDate>2011-01-13</eb:DueDate></eb:PaymentConditions><eb:PresentationDetails><eb:URL>www.austriapro.at</eb:URL><eb:SuppressZero>true</eb:SuppressZero></eb:PresentationDetails></eb:Invoice>

 


Spezialist für Verschlüsselung, Digitale Signatur, Smart Card, elektronische Rechnung, Liquiditätssteuerung,VSTO Entwicklung, http://www.bogad.at

XML document append child and escape special characters

$
0
0

I am facing this specific scenario where my escape sequences are getting replaced twice.

I have a code similar placed similar as below:

XmlDocument xmldoc=new XmlDocument();

XmlNode root=xmldoc.CreateElement("root");

XmlNode node=xmldoc.CreateElement("test");

string str="This is \"Country's\" & nations challenge";

//All escape sequences are removed.Below finctions correctly and replaces all special characters

node.InnerText= System.Security.SecurityElement.Escape(str);

//This will again replace and only & with &amp; is anything wrong here? so text &quot; will be replaced with &amp;qout

root.AppendChild(node);

I tried  it by giving  node.Innertext=str; just to avoid double replacement but it seems appendchild only replaces & with an &amp;

Is there a proper way to resolve this issue?

 

XML lite reader example

$
0
0

Hi I'm trying to run this example and for some reason it compiles but fails to read file when I steep through code it fails in wmain

on the first if statement witch is

    if (argc != 2)
    {
        wprintf(L"Usage: XmlLiteReader.exe name-of-input-file\n");
        return 0;
    }

can you please tell me why this is happening ?

I am trying to find a formal statement from Microsoft about the end of support on MSXML4 SP3

$
0
0

I am trying to find a formal statement from Microsoft about the end of support on MSXML4 SP3 but have only found details from other people or about SP2. Can anyone point me in the right direction please?


Der Alter

Should be simple LINQ to XML

$
0
0

Consider I have a XML something like this   ( Goal is to return a dictionary with keyValuePair of key =owner, and value =element name ( ie personal or business )  - how do I get at just the childNode Name  ??

<cars>

<car ownerID ='1234'>

<personal someattribute="">

</car>

<car ownerID ='1445'>

<business someattribute="">

</car>

</cars>

public Dictionary<string,string> GetElementsAttributeWithFirstNodeName(string XMLFragSource, string elementName, string attributeName)
        {
            var myKeyValReturn   = new Dictionary<string, string> ();  // once subnode name can be returned.


            XElement allData = XElement.Parse(XMLFragSource);
            if (allData != null)
            {
                IEnumerable<XElement> Test_Elements = allData.Descendants(elementName);
                foreach (XElement telement in Test_Elements)
               // retVal.Add(telement.Attribute(attributeName).Value + "type=" + telement.FirstNode);  // want nodeName of firstNode
                myKeyValReturn.Add(telement.Attribute(attributeName).Value, "looking for telement.FirstNode.Name");
            }

            return myKeyValReturn;

        }

Thanks !!!


andrew

Viewing all 935 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>