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

Generate MS Word Document saved in XML format- Footer image Problem

$
0
0

 

Hi,

Using XML ,we are generating MS Word report.

We are using Request MIME type to generate Report.

Here we can able to generate report data and header.

In Footer part, our Requirement is Current Date, No of Pages and Image.

Except footer image we can able to generate MS Word Document in ASP.NET.

If any body know how to handle footer image in XML ,Word Document, Please let me know.

I tried last one week, i can't able to solve this problem.It is very urgent one.

 

Advance Thanks,

Kasimayan.C


Xml Validation - .NET vs MSXML6

$
0
0

Is .NET XML validation against xml schema faster then the one in MSXML6.

I am currently using MSXML6 validation in C++ project, and i get slower results then in .NET.

I'm using reader approach (SAXParser in C++ vs. XmlReader in .NET).

Shouldn't non-NET be faster?


Error with set namespaces in Xaml

$
0
0

I have an app which is generating Xaml for a WPF application. The problem is that when generating the XML each element is given a blank xmlns=" " within each element node which is breaking the Xaml. How do I prevent the xmlns=" " from been outputted in the Xaml file?

If I remove the xmlns=" " from the Xaml the form is correct, or if I add a button, the auto generated code looks the same as the button code of the visually added button

 The generating code looks like this :-

XmlDocument

doc = newXmlDocument();

doc.Load(xamlFile.Document.FullName);   

XmlNodeListnodes = doc.GetElementsByTagName("Grid");

XmlNode node = node.Item(0);

...

XmlElement xmlElement = doc.CreateElement("Button");

...  set attributes

node.AppendChild(xmlElement);

doc.save(..);

The resultant errored Xaml looks like this

<

<Window x:Class="WindowsFormsApplication_UWP.Form1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Form1" Height="300" Width="300"><Grid><Button Name="btnOne" Width="134" Height="101" Margin="42,66,0,0" Content="btnOne" HorizontalAlignment="Left" VerticalAlignment="Top" Click="btnOne_Click" xmlns=" " /></Grid></Window>




SignXml verify signature Xpath2 transformation

Text is not hiding in OOXml

$
0
0

With vsto I am trying to hide/unhide a particular paragraph in the document this works fine for word 2007, but it is not hiding for word 2013

Please find OOXML part of word

-<w:p w:rsidRDefault="007D06C4" w:rsidR="007D06C4">

-<w:pPr>

<w:pStyle w:val="APPracticalBulleted"/>

-<w:numPr>

<w:ilvl w:val="1"/>

<w:numId w:val="8"/>

</w:numPr>

<w:ind w:left="1080"/>

<w:divId w:val="1731733867"/>

</w:pPr>

-<w:r>

-<w:rPr>

<w:vanish w:val="0"/>

</w:rPr>

<w:t>Sample text;</w:t>

</w:r>

</w:p>


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.

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



Can't get my xpath working with selectsinglenode

$
0
0

Hi all,

I am having huge problems to get a simple xpath working on a xmldocument.

Here is the xml file i am trying to get the values from:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><SearchProductsResponse xmlns="http://api.zanox.com/namespace/2011-03-01/"><page>0</page><items>10</items><total>385</total><query>nike</query><productItems><productItem id="92c9644ce15d337077e35756167c7578"><name>Nike - Retro-Jersey-Shorts - Blau</name><modified>2015-08-27T03:04:49+02:00</modified><program id="7408">Asos.com DE</program><price>20.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike/Nike-Jersey-Retro-Shorts/Prod/pgeproduct.aspx?iid=5019559&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rlxmpwqit&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike/Nike-Jersey-Retro-Shorts/Prod/pgeproduct.aspx?iid=5019559&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rlxmpwqit&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - Retro-Jersey-Shorts - Blau - Farbe:Blau</description><descriptionLong>Shorts von Nike weiches Jersey Taillenbund mit Kordelzug schräge Seitentaschen Straight Fit - gerader Beinschnitt Maschinenwäsche 100% Baumwolle Model trägt Größe M und ist 178 cm/5 Fuß 10 Zoll groß</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3180000">Shorts</category><image><large>http://images.asos-media.com/inv/media/9/5/5/9/5019559/blue/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Herren / Nike / Shorts</merchantCategory><merchantProductId>3475300</merchantProductId></productItem><productItem id="49b14a23c4422f9f60a26621923f1836"><name>Nike - Shorts, 10 Zoll - Schwarz</name><modified>2015-08-28T03:04:10+02:00</modified><program id="7408">Asos.com DE</program><price>28.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike-Shorts-00-Zoll/169rgc/?iid=4864074&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=pitiiprqr&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike-Shorts-00-Zoll/169rgc/?iid=4864074&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=pitiiprqr&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - Shorts, 10 Zoll - Schwarz - Farbe:Schwarz</description><descriptionLong>Shorts von Nike weiches gewebtes Material durchgehendes Netzfutter Elastischer Bund mit Kordel Logostickerei Loose Fit - fällt locker über den Körper Maschinenwäsche 100% Polyester Model trägt Größe M und ist 178 cm/5 Fuß 10 Zoll groß</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3180000">Shorts</category><image><large>http://images.asos-media.com/inv/media/4/7/0/4/4864074/black/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Herren / Nike / Shorts</merchantCategory><merchantProductId>3343248</merchantProductId></productItem><productItem id="05e7117ada8960185edda22195219490"><name>Nike - AW77 - Jogginghose mit Bündchen - Kalkgrau</name><modified>2015-08-30T03:04:29+02:00</modified><program id="7408">Asos.com DE</program><price>48.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike/Nike-AW77-Cuffed-Joggers/Prod/pgeproduct.aspx?iid=5017389&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=lirplimta&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike/Nike-AW77-Cuffed-Joggers/Prod/pgeproduct.aspx?iid=5017389&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=lirplimta&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - AW77 - Jogginghose mit Bündchen - Kalkgrau - Farbe:Kalkgrau</description><descriptionLong>Jogginghosen von Nike Sweatshirt-Stoff Taillenbund mit Kordelzug drei Taschen Rippenbündchen schmale Passform, sitzt eng am Körper Maschinenwäsche 100% Baumwolle Model trägt Größe M und ist 178 cm/5 Fuß 10 Zoll groß</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3170000">Shirts &amp; Tops</category><image><large>http://images.asos-media.com/inv/media/9/8/3/7/5017389/greymarl/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Herren / Nike / T-Shirts</merchantCategory><merchantProductId>3473419</merchantProductId></productItem><productItem id="f98159a9f7b271a6ea8695460a316093"><name>Nike - Windrunner - Jacke 544119-088</name><modified>2015-08-26T03:04:30+02:00</modified><program id="7408">Asos.com DE</program><price>52.49</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike-Windjacke/17f3je/?iid=5018248&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rqqaqqqpq&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike-Windjacke/17f3je/?iid=5018248&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rqqaqqqpq&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - Windrunner - Jacke 544119-088 - Farbe:</description><descriptionLong>Nike - Windrunner - Jacke 544119-088</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3000000">Fashion &amp; Accessories</category><image><large>http://images.asos-media.com/inv/media/8/4/2/8/5018248/grey/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Bekleidung &amp; Accessoires</merchantCategory><merchantProductId>3474195</merchantProductId></productItem><productItem id="6c68dc7d6f90083424794c4d5e19bc10"><name>Nike - HW77 - Sweatshirt</name><modified>2015-08-26T03:04:30+02:00</modified><program id="7408">Asos.com DE</program><price>44.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike/Nike-AW77-Sweatshirt/Prod/pgeproduct.aspx?iid=4872363&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=plamplriw&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike/Nike-AW77-Sweatshirt/Prod/pgeproduct.aspx?iid=4872363&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=plamplriw&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - HW77 - Sweatshirt - Farbe:</description><descriptionLong>Nike - HW77 - Sweatshirt</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3150000">Pullovers</category><image><large>http://images.asos-media.com/inv/media/3/6/3/2/4872363/grey/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Bekleidung &amp; Accessoires</merchantCategory><merchantProductId>3350172</merchantProductId></productItem><productItem id="0520b12655033a3e093f594da4cdf6a0"><name>Nike - Pro Fierce - Sport-BH</name><modified>2015-08-23T03:04:59+02:00</modified><program id="7408">Asos.com DE</program><price>25.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike-Pro-Fierce-Sport-BH/16q6pc/?iid=4697141&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rxamprmqm&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike-Pro-Fierce-Sport-BH/16q6pc/?iid=4697141&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rxamprmqm&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - Pro Fierce - Sport-BH - Farbe:</description><descriptionLong>Sport-BH von Nike seidiges, elastisches Material U-Ausschnitt weiche Körbchen Unterbrustband für zusätzichen Halt kontrastierendes Stretch-Unterband Racerback-Träger aus Netz Maschinenwäsche 88% Polyester, 12% Elastan</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3000000">Fashion &amp; Accessories</category><image><large>http://images.asos-media.com/inv/media/1/4/1/7/4697141/bluelagoonvolt/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Bekleidung &amp; Accessoires</merchantCategory><merchantProductId>3201140</merchantProductId></productItem><productItem id="2dde5022488f19d30cfb86dacc267627"><name>Nike - Solarsoft - Flip-Flops - Schwarz</name><modified>2015-07-31T03:01:00+02:00</modified><program id="7408">Asos.com DE</program><price>16.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike-Solarsoft-Flip-Flops/16cjh5/?iid=4757251&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rxampratr&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike-Solarsoft-Flip-Flops/16cjh5/?iid=4757251&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rxampratr&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - Solarsoft - Flip-Flops - Schwarz - Farbe:Schwarz</description><descriptionLong>Flip-Flops von Nike Logo-Applikation zum Überziehen Zehensteg flache Profilsohle Mit einem sauberen, feuchten Schwamm reinigen Obermaterial: 100% sonstige Materialien</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3250000">Shoes</category><image><large>http://images.asos-media.com/inv/media/1/5/2/7/4757251/black/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Bekleidung &amp; Accessoires</merchantCategory><merchantProductId>3252419</merchantProductId></productItem><productItem id="cd7d35a9deb04eef8f31c438703856de"><name>Nike - Pilotensonnenbrille - Schwarz</name><modified>2015-08-26T03:04:30+02:00</modified><program id="7408">Asos.com DE</program><price>88.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike-Pilotensonnenbrille/16y9rp/?iid=4947727&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rppawtwtw&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike-Pilotensonnenbrille/16y9rp/?iid=4947727&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=rppawtwtw&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - Pilotensonnenbrille - Schwarz - Farbe:Schwarz</description><descriptionLong>Sonnenbrille von Nike leichter Pilotenrahmen doppelter Nasensteg geformte Nasenpolster für zusätzlichen Komfort abgestuft getönte Gläser logoverzierte Bügel mit abgerundeten Enden für sicheren Halt voller UV-Schutz Gläsergröße: 61mm</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="0" /><image><large>http://images.asos-media.com/inv/media/7/2/7/7/4947727/black/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Herren / Sale / Accessoires / Pilotenbrille</merchantCategory><merchantProductId>3414148</merchantProductId></productItem><productItem id="4bfbb0cfeab1bea32103174e3168409c"><name>Nike - Jordan - Shorts - Schwarz</name><modified>2015-08-26T03:04:30+02:00</modified><program id="7408">Asos.com DE</program><price>44.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike-Jordan-Shorts/184k9f/?iid=5452666&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=lqxtwqmwx&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike-Jordan-Shorts/184k9f/?iid=5452666&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=lqxtwqmwx&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike - Jordan - Shorts - Schwarz - Farbe:Schwarz</description><descriptionLong>Shorts von Jordan atmungsaktiver Netzstoff elastischer Bund Aufdruck vorne Seitentaschen Loose Fit - fällt locker über den Körper Maschinenwäsche 100% Polyester Unser Model trägt Größe M und ist 185,5 cm/6 Fuß, 1 Zoll groß</descriptionLong><manufacturer>Jordan</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3180000">Shorts</category><image><large>http://images.asos-media.com/inv/media/6/6/6/2/5452666/black/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Herren / Shorts / Jersey</merchantCategory><merchantProductId>3852709</merchantProductId></productItem><productItem id="b4a8b6fb02ccdc53405ca420dd527241"><name>Nike Air - Safari - Turnschuhe - Schwarz</name><modified>2015-08-26T03:04:30+02:00</modified><program id="7408">Asos.com DE</program><price>76.99</price><currency>EUR</currency><trackingLinks><trackingLink adspaceId="1009338"><ppv>http://ad.zanox.com/ppv/?22436292C14041752&amp;ULP=[[Nike-Air-Safari-Turnschuhe/16b7vu/?iid=4759797&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=plampliqp&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppv><ppc>http://ad.zanox.com/ppc/?22436292C14041752&amp;ULP=[[Nike-Air-Safari-Turnschuhe/16b7vu/?iid=4759797&amp;istCompanyId=030f1ff6-3a15-4425-bccd-ba2bdee3fa38&amp;istItemId=plampliqp&amp;istBid=t&amp;channelref=affiliate]]&amp;zpar9=[[43EEF0445509C7205827]]</ppc></trackingLink></trackingLinks><description>Nike Air - Safari - Turnschuhe - Schwarz - Farbe:Schwarz</description><descriptionLong>Turnschuhe von Nike Obermaterial aus Leder und Netzstoff Schnürverschluss geformter, gepolsterter Schaft mit Logo an der Seite dicke, stützende, strapazierfähige Sohle strukturierte, griffige Sohle mit geeignetem Pflegemittel behandeln 50% Echtleder, 50% Stoff</descriptionLong><manufacturer>Nike</manufacturer><deliveryTime>2 to 4 days</deliveryTime><category id="3000000">Fashion &amp; Accessories</category><image><large>http://images.asos-media.com/inv/media/7/9/7/9/4759797/black/image1xxl.jpg</large></image><shippingCosts>3.0</shippingCosts><shipping>3.0</shipping><merchantCategory>Bekleidung &amp; Accessoires</merchantCategory><merchantProductId>3254596</merchantProductId></productItem></productItems></SearchProductsResponse>

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(MapPath("~/App_Data/zanox.xml"));
string name = xmlDoc.SelectSingleNode(@"/SearchProductsResponse/productItems/productItem[1]/name").InnerText;
The above code is what i am using to try to get the value from the name field :

Has anyone a idea on what i am doing wrong?



Removing an element but keeping its child nodes with XSL.

$
0
0
Hi everyone,

How do I go about transforming the XML document below into result.xml? Basically what I'm aiming for is to remove one of the element but keeping the children. So I would like to remove the <Location> element but keep the <City> element (the <City> element being the child element of <Location>). Any pointers would be greatly appreciated. Thanks!

<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-alt:"Calisto MT"; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-alt:"Times New Roman"; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} span.EmailStyle15 {mso-style-type:personal; mso-style-noshow:yes; mso-style-unhide:no; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; color:windowtext;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 72.0pt 72.0pt 72.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

<User>

  <TITLE>Mrs</TITLE>

  <INITIALS>D</INITIALS>

  <FIRST_NAME>Doris</FIRST_NAME>

  <LAST_NAME>Smith</LAST_NAME>

<Location>

      <City>London</City>

</Location>

</User>

 

** How do I transform this to**

 

<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-alt:"Calisto MT"; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-alt:"Times New Roman"; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} span.EmailStyle15 {mso-style-type:personal; mso-style-noshow:yes; mso-style-unhide:no; mso-ansi-font-size:11.0pt; mso-bidi-font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; color:windowtext;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 72.0pt 72.0pt 72.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

<User>

  <TITLE>Mrs</TITLE>

  <INITIALS>D</INITIALS>

  <FIRST_NAME>Doris</FIRST_NAME>

  <LAST_NAME>Smith</LAST_NAME>

  <City>London</City>

</User>




Linq To Xml From Xml Column in Database

$
0
0

All, I have a database field with a string xml column.

I was trying to query the database for each string value and create a new XDocument / XElement and then query the xml for certain values. I keep getting the following error, when I use the string value from the database ... (This is from Linqpad)

Data at the root level is invalid. Line 1, position 1

However, if I take the same value from the database and create an xml file from it. It works fine.

This seems to be an encoding issue; but I haven't been able to solve it. I would rather not have to query each record, write it to a file and then process it. Any ideas on how to solve this problem?

my linq to sql query is ..

var query = from c in CmsContentXmls
where c.NodeId.Equals("1136")
select c.Xml;

my linq to xml query is ...

string sampleXML = query.ToString();
var doc = XElement.Load(new StringReader(sampleXML));

var results =
from e in doc.Descendants()
select e.Parent;
dpimental

Syntax help MSXML2.XMLHTT object

$
0
0

Hi There,

I am trying to use the MSXML2.XMLHTTP.6.0 active x object to implement an integration with docusign but seem to be having troubles.

Here is the example provided by docusign.

POST http://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes

X-DocuSign-Authentication: <DocuSignCredentials><Username>{name}</Username><Password>{password}</Password><IntegratorKey>{integrator_key}</IntegratorKey></DocuSignCredentials>

Accept: application/json

Content-Type: multipart/form-data; boundary=AAA

--AAA

Content-Type: application/json

Content-Dis"code" style="font:10pt/normal 'Courier New';color:#000000;text-transform:none;text-indent:0px;letter-spacing:normal;margin-margin-bottom:0px;word-spacing:0px;white-space:normal;widows:1;background-color:#e6e6fa;-webkit-text-stroke-width:0px;">{

  "status":"sent",

  "emailBlurb":"Test Email Body",

  "emailSubject": "Test Email Subject - EnvelopeDefFull",

  "documents": [{

      "name": "test1.pdf",

      "documentId":"1",

      "order":"1"

  }],

  "recipients": {

    "signers" : [{

      "email": "m.rosey@thomasind.com ",

      "name": "Mike Rosey",

      "recipientId":"1",

    }]

  }

}

--AAA

Content-Type: application/pdf

Content-Dis filename="test1.pdf";documentid=1

<documents removed>

--AAA--

Here is my attempted translation which does not work:

oxmlhttprequest = createobject("MSXML2.XMLHTTP.6.0")

oxmlhttprequest.open("POST","https://demo.docusign.net/restapi/v2/accounts/738204/envelopes",.f.)

oxmlhttprequest.setrequestheader("Content-Type","application/json")

oxmlhttprequest.setrequestheader("Accept","application/json")

oxmlhttprequest.setrequestheader("X-DocuSign-Authentication","<DocuSignCredentials><Username>My username</Username><Password>My password</Password><IntegratorKey>My Key</IntegratorKey></DocuSignCredentials>")

cstr = '--AAA'

cstr = cstr + 'Content-Type: application/json'

cstr = cstr + 'Content-Dis"color:#1f497d;">cstr = cstr + '{'

cstr = cstr + '     "status":"sent",'

cstr = cstr + '     "emailBlurb":"Test Email Body",'

cstr = cstr + '     "emailSubject": "Test Email Subject - EnvelopeDefFull",'

cstr = cstr + '     "documents": [{'

cstr = cstr + '                     "name": "test1.pdf",'    

cstr = cstr + '                     "documentId":"1",'

cstr = cstr + '                     "order":"1"'

cstr = cstr + '     }],'

cstr = cstr + '     "recipients": {'

cstr = cstr + '                     "signers" : [{'

cstr = cstr + '                                    "email": "smckay@power-broker.com",'

cstr = cstr + '                                    "name": "Stuart John McKay",'

cstr = cstr + '                                    "recipientId":"1",'

cstr = cstr + '                     }]'

cstr = cstr + '     }'            

cstr = cstr + '}'

cstr = cstr + '--AAA'

cstr = cstr + 'Content-Type: application/pdf'

cstr = cstr + 'Content-Dis filename="test1.pdf";documentid=1'

cstr = cstr + '<documents removed>'

cstr = cstr + '--AAA--'

oxmlhttprequest.send(cstr)

Any input would be greatly appreciated.

Stuart

ExecuteXmlReader() returns none value

$
0
0

When I try to build an XmlReader object with ExcuteXmlReader function, it returns none object. but when I test the same query directly in SQL Server Management it works correctly.

command = new SqlCommand(olapCommand + " FOR XML AUTO, XMLDATA", CommandConnection);
XmlReader xr = command.ExecuteXmlReader();
xml = xr.Value;

How could I fix it?


When will MSXML support schema 1.1 and XPath 2.0

$
0
0
When will MSXML support schema 1.1 and XPath 2.0?

Convert the string/text as formula using XSLT

$
0
0

Hi All,

I am using XSLT to have XML data and Providing it to Excel.

I am having excel formula generated in C# code, generated formula is "=IF(COUNTIF(D5:H5,"yes")>=1,C5,0) + IF(COUNTIF(D6:H6,"yes")>=1,C6,0) + IF(COUNTIF(D7:H7,"yes")>=1,C7,0) + IF(COUNTIF(D8:H8,"yes")>=1,C8,0)+ IF(COUNTIF(D9:H9,"yes")>=1,C9,0)"

Above generated formula is assigned in the XML element.

But when I open the Excel file this formula is considered as text, this formula is not getting applied.

I have to press the Enter Key to evaluate the formula.

Any suggestion to convert this text in formula ?
Please kindly let me know.

Thanks,

Adding prefixes to XML nodes

$
0
0

i have some classes

class a{ public b _b = new b()...}
class b{...}
class c{...}
class z{...}
class q{...}

they are building a complex class which contains all this classes

class X{
  public a _a = new a();
  ...
}

when i seralized this X to a XML it has been serialized like below

<a><b><c></c></b><z><q></q></z></a>

But i want to add some prefixes to them at the class level like below

<a><sh:b><sh:c><mh:d><mh:/d><sh:/c><sh:/b><z ef:>< ef: q><ef: /q><ef: /z></a>

i have tryed to add from attribute by XmlRoot attribute but it just added first node

is there any manner.. thnks...


Hamit YILDIRIM


XSD Dataset Serialisation Error

$
0
0

Respected Experts,

I created a Class of an XSD file by

XSD /d /l:cd StockItem.XSD /n:kings.erp which is attached here

<?xml version="1.0" standalone="yes"?><xs:schema id="ENVELOPE" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element name="LANGUAGENAME.LIST"><xs:complexType><xs:sequence><xs:element name="LANGUAGEID" type="xs:string" minOccurs="0" /><xs:element name="NAME.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="NAME" type="xs:string" minOccurs="0" msdata:Ordinal="0" /></xs:sequence><xs:attribute name="TYPE" type="xs:string" /></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="ENVELOPE" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"><xs:complexType><xs:choice minOccurs="0" maxOccurs="unbounded"><xs:element ref="LANGUAGENAME.LIST" /><xs:element name="HEADER"><xs:complexType><xs:sequence><xs:element name="TALLYREQUEST" type="xs:string" minOccurs="0" /></xs:sequence></xs:complexType></xs:element><xs:element name="BODY"><xs:complexType><xs:sequence><xs:element name="IMPORTDATA" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="REQUESTDESC" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="REPORTNAME" type="xs:string" minOccurs="0" /><xs:element name="STATICVARIABLES" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="SVCURRENTCOMPANY" type="xs:string" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="REQUESTDATA" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="TALLYMESSAGE" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="STOCKITEM" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="PARENT" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="CATEGORY" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="TAXCLASSIFICATIONNAME" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="COSTINGMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="3" default="Avg. Cost" /><xs:element name="VALUATIONMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="4" default="Avg. Price" /><xs:element name="BASEUNITS" type="xs:string" minOccurs="0" msdata:Ordinal="5" /><xs:element name="ADDITIONALUNITS" type="xs:string" minOccurs="0" msdata:Ordinal="6" /><xs:element name="EXCISEITEMCLASSIFICATION" type="xs:string" minOccurs="0" msdata:Ordinal="7" default="Default" /><xs:element name="ISCOSTCENTRESON" type="xs:string" minOccurs="0" msdata:Ordinal="8" default="No"/><xs:element name="ISBATCHWISEON" type="xs:string" minOccurs="0" msdata:Ordinal="9" default="No" /><xs:element name="ISPERISHABLEON" type="xs:string" minOccurs="0" msdata:Ordinal="10" default="No"/><xs:element name="ISENTRYTAXAPPLICABLE" type="xs:string" minOccurs="0" msdata:Ordinal="11" default="No"/><xs:element name="IGNOREPHYSICALDIFFERENCE" type="xs:string" minOccurs="0" msdata:Ordinal="12" default="No"/><xs:element name="IGNORENEGATIVESTOCK" type="xs:string" minOccurs="0" msdata:Ordinal="13" default="Yes" /><xs:element name="TREATSALESASMANUFACTURED" type="xs:string" minOccurs="0" msdata:Ordinal="14" default="No"/><xs:element name="TREATPURCHASESASCONSUMED" type="xs:string" minOccurs="0" msdata:Ordinal="15" default="No"/><xs:element name="TREATREJECTSASSCRAP" type="xs:string" minOccurs="0" msdata:Ordinal="16" default="No"/><xs:element name="HASMFGDATE" type="xs:string" minOccurs="0" msdata:Ordinal="17" default="No"/><xs:element name="ALLOWUSEOFEXPIREDITEMS" type="xs:string" minOccurs="0" msdata:Ordinal="18" default="No" /><xs:element name="IGNOREBATCHES" type="xs:string" minOccurs="0" msdata:Ordinal="19"  default="No"/><xs:element name="IGNOREGODOWNS" type="xs:string" minOccurs="0" msdata:Ordinal="20" default="Yes"/><xs:element name="EXCLUDEJRNLFORVALUATION" type="xs:string" minOccurs="0" msdata:Ordinal="21"  default="No"/><xs:element name="ISMRPINCLOFTAX" type="xs:string" minOccurs="0" msdata:Ordinal="22"  default="No"/><xs:element name="ISADDLTAXEXEMPT" type="xs:string" minOccurs="0" msdata:Ordinal="23" default="No"/><xs:element name="ISSUPPLEMENTRYDUTYON" type="xs:string" minOccurs="0" msdata:Ordinal="24" default="No"/><xs:element name="REORDERASHIGHER" type="xs:string" minOccurs="0" msdata:Ordinal="25" default="No"/><xs:element name="MINORDERASHIGHER" type="xs:string" minOccurs="0" msdata:Ordinal="26" default="No"/><xs:element name="DENOMINATOR" type="xs:string" minOccurs="0" msdata:Ordinal="27" default="1"/><xs:element name="RATEOFVAT" type="xs:string" minOccurs="0" msdata:Ordinal="28" /><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="STOCKGROUP" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="PARENT" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="COSTINGMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="1" default="Avg. Cost"/><xs:element name="VALUATIONMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="2" default="Avg. Price"/><xs:element name="BASEUNITS" type="xs:string" minOccurs="0" msdata:Ordinal="3" /><xs:element name="ADDITIONALUNITS" type="xs:string" minOccurs="0" msdata:Ordinal="4" /><xs:element name="ISBATCHWISEON" type="xs:string" minOccurs="0" msdata:Ordinal="5" default="No"/><xs:element name="ISPERISHABLEON" type="xs:string" minOccurs="0" msdata:Ordinal="6" default="No"/><xs:element name="ISADDABLE" type="xs:string" minOccurs="0" msdata:Ordinal="7" default="No"/><xs:element name="IGNOREPHYSICALDIFFERENCE" type="xs:string" minOccurs="0" msdata:Ordinal="8" default="No"/><xs:element name="IGNORENEGATIVESTOCK" type="xs:string" minOccurs="0" msdata:Ordinal="9" default="No"/><xs:element name="TREATSALESASMANUFACTURED" type="xs:string" minOccurs="0" msdata:Ordinal="10" default="No"/><xs:element name="TREATPURCHASESASCONSUMED" type="xs:string" minOccurs="0" msdata:Ordinal="11" default="No"/><xs:element name="TREATREJECTSASSCRAP" type="xs:string" minOccurs="0" msdata:Ordinal="12" default="No"/><xs:element name="HASMFGDATE" type="xs:string" minOccurs="0" msdata:Ordinal="13" default="No"/><xs:element name="ALLOWUSEOFEXPIREDITEMS" type="xs:string" minOccurs="0" msdata:Ordinal="14" default="No"/><xs:element name="IGNOREBATCHES" type="xs:string" minOccurs="0" msdata:Ordinal="15" default="No"/><xs:element name="IGNOREGODOWNS" type="xs:string" minOccurs="0" msdata:Ordinal="16" default="No"/><xs:element name="DENOMINATOR" type="xs:string" minOccurs="0" msdata:Ordinal="17" default="1"/><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="GODOWN" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="EXCISEREGISTRATIONDATE" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="PINCODE" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="PHONENUMBER" type="xs:string" minOccurs="0" msdata:Ordinal="3" /><xs:element name="EXCISERANGE" type="xs:string" minOccurs="0" msdata:Ordinal="4" /><xs:element name="EXCISERANGEADDRESS" type="xs:string" minOccurs="0" msdata:Ordinal="5" /><xs:element name="EXCISEDIVISIONADDRESS" type="xs:string" minOccurs="0" msdata:Ordinal="6" /><xs:element name="EXCISECOMMISSIONERATE" type="xs:string" minOccurs="0" msdata:Ordinal="7" /><xs:element name="EXCISERANGECODE" type="xs:string" minOccurs="0" msdata:Ordinal="8" /><xs:element name="EXCISEDIVISIONCODE" type="xs:string" minOccurs="0" msdata:Ordinal="9" /><xs:element name="PARENT" type="xs:string" minOccurs="0" msdata:Ordinal="10" /><xs:element name="EXCISEREGNO" type="xs:string" minOccurs="0" msdata:Ordinal="11" /><xs:element name="JOBNAME" type="xs:string" minOccurs="0" msdata:Ordinal="12" /><xs:element name="EXCISEREGISTRATIONTYPE" type="xs:string" minOccurs="0" msdata:Ordinal="13" /><xs:element name="EXCISEMAILINGNAME" type="xs:string" minOccurs="0" msdata:Ordinal="14" /><xs:element name="EXCISEMANUFACTURERTYPE" type="xs:string" minOccurs="0" msdata:Ordinal="15" /><xs:element name="EXCISELARGETAXPAYER" type="xs:string" minOccurs="0" msdata:Ordinal="16" /><xs:element name="EXCISEDIVISIONNAME" type="xs:string" minOccurs="0" msdata:Ordinal="17" /><xs:element name="EXCISECOMSNRATECODE" type="xs:string" minOccurs="0" msdata:Ordinal="18" /><xs:element name="EXCISECOMSNRATEADDRESS" type="xs:string" minOccurs="0" msdata:Ordinal="19" /><xs:element name="HASNOSPACE" type="xs:string" minOccurs="0" msdata:Ordinal="20" /><xs:element name="HASNOSTOCK" type="xs:string" minOccurs="0" msdata:Ordinal="21" /><xs:element name="ADDRESS.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="ADDRESS" nillable="true" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:simpleContent msdata:ColumnName="ADDRESS_Text" msdata:Ordinal="0"><xs:extension base="xs:string"></xs:extension></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="TYPE" type="xs:string" /></xs:complexType></xs:element><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /><xs:element name="SERIALNUMBERLIST.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="EXCISEBOOKNAME" type="xs:string" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="TARIFFCLASSIFICATION" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="HSN" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="USEDFOR" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="SORTPOSITION" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="SERIALNUMBER" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="NUMBERINGMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="PREVENTDUPLICATES" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="PREFILLZERO" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="BEGINNINGNUMBER" type="xs:string" minOccurs="0" msdata:Ordinal="3" /><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /><xs:element name="RESTARTFROMLIST.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="DATE" type="xs:string" minOccurs="0" /><xs:element name="RESTARTFROM" type="xs:string" minOccurs="0" /><xs:element name="PERIODBEGINNIGNUM" type="xs:string" minOccurs="0" /><xs:element name="LASTNUMBERLIST.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="DATE" type="xs:string" minOccurs="0" /><xs:element name="LASTNUMBER" type="xs:string" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="CURRENCY" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="ORIGINALNAME" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="MAILINGNAME" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="EXPANDEDSYMBOL" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="DECIMALSYMBOL" type="xs:string" minOccurs="0" msdata:Ordinal="3" /><xs:element name="ISSUFFIX" type="xs:string" minOccurs="0" msdata:Ordinal="4" /><xs:element name="HASSPACE" type="xs:string" minOccurs="0" msdata:Ordinal="5" /><xs:element name="INMILLIONS" type="xs:string" minOccurs="0" msdata:Ordinal="6" /><xs:element name="DECIMALPLACES" type="xs:string" minOccurs="0" msdata:Ordinal="7" /><xs:element name="DECIMALPLACESFORPRINTING" type="xs:string" minOccurs="0" msdata:Ordinal="8" /></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="UNIT" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="ISSIMPLEUNIT" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="DECIMALPLACES" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="NAME" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="RESERVEDNAME" type="xs:string" minOccurs="0" msdata:Ordinal="3" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema>

on using the generated class

 XmlSerializer s = new XmlSerializer(typeof(ENVELOPE));
            System.IO.TextWriter w = new System.IO.StreamWriter(@"C:\temp\stocktest.xml");
            s.Serialize(w, new ENVELOPE()); w.Close();

I m getting error

The same table 'LANGUAGENAME.LIST' cannot be the child table in two nested relations.

how can i solve it

Whats wrong in my xsd schema ? It gives type element is not declared on include of another xsd file

$
0
0

I am trying to validate a xml using schema but the problem is xsd is not valid, i tried ti tested if it valid or not, it gives error XSD schema Error: Type 'eltyp_string035' is not declared. My code to verify the schema is here :

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Schema;

namespace testingXmlValidation
{
    class Program
    {
        static StringBuilder errors = new StringBuilder();
        static void Main(string[] args)
        {

                string xsdPath = null;
                 xsdPath = "C:/Users/testing/a.xsd";
                elementName = "SpeTrans";

                try
                {
                    XmlSchemaCollection sc = new XmlSchemaCollection();
                    sc.Add("testNamespaces", xsdPath);
                    Console.WriteLine("No Schema error.");
                }
                catch (XmlSchemaException ex)
                {
                    Console.WriteLine("XSD schema Error: {0}", ex.Message);
                }

                Console.ReadKey();

         }
    }

}

My main xsd file is below It seems that either the problem is in this include or the file command.xsd which is included because it contains "eltyp_string035" declaration :

?xml version="1.0" encoding="utf-8" ?><!--Created with Liquid XML 2015 Designer Edition 13.2.0.5980 (http://www.liquid-technologies.com)--><!-- Version 1.0.1  du 14/09/2015: TypNoiSuiviE à TypNotSuiviE --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="testNamespaces"><xs:include schemaLocation="C:/Users/ACER/Desktop/KT-iNDIA/September/24thseptember2015-KtIndia/Shakhar24092015/xsdFile/common.xsd" /><xs:element name="Spetrans"><xs:complexType><xs:sequence minOccurs="1"><xs:element name="TypNotSuiviE" minOccurs="0" default="0"><xs:annotation><xs documentation>Forçage Type de notification pour le suivi « Expéditeur »</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="xs:integer"><xs:totalDigits value="1" /><xs:enumeration value="0" /><xs:enumeration value="1" /><xs:enumeration value="2" /></xs:restriction></xs:simpleType></xs:element><xs:element name="TypNotSuiviO" minOccurs="0" default="0"><xs:annotation><xs:documentation>Forçage Type de notification pour le suivi « Donneur d’ordre »</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="xs:integer"><xs:totalDigits value="1" /><xs:enumeration value="0" /><xs:enumeration value="1" /><xs:enumeration value="2" /></xs:restriction></xs:simpleType></xs:element><xs:element name="TypNotSuiviD" minOccurs="1" default="0"><xs:annotation><xs:documentation>Forçage Type de notification pour le suivi « Donneur d’ordre »</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="xs:integer"><xs:totalDigits value="1" /><xs:enumeration value="0" /><xs:enumeration value="1" /><xs:enumeration value="2" /></xs:restriction></xs:simpleType></xs:element><xs:element name="ContDest" type="eltyp_string035" minOccurs="0" ><xs:annotation><xs:documentation>Nom du contact Destinataire</xs:documentation></xs:annotation></xs:element><xs:element name="MailDest" type="eltyp_string035" minOccurs="0" ><xs:annotation><xs:documentation>Email du contact Destinataire</xs:documentation></xs:annotation></xs:element><xs:element name="TelDest" type="eltyp_string020" minOccurs="0"><xs:annotation><xs:documentation>Téléphone du contact Destinataire</xs:documentation></xs:annotation></xs:element><xs:element name="GsmDest" type="eltyp_string020" minOccurs="0"><xs:annotation><xs:documentation>Téléphone GSM du contact Destinataire</xs:documentation></xs:annotation></xs:element><xs:element name="ValDecAssu" minOccurs="0"><xs:annotation><xs:documentation>Valeur Assurance En Centimes</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string009"><xs:pattern value="[0-9]{9}" /></xs:restriction></xs:simpleType></xs:element><xs:element name="ValDevAssu" minOccurs="0" default="EUR"><xs:annotation><xs:documentation>Devise valeur Assurance</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string003"><xs:enumeration value="EUR" /></xs:restriction></xs:simpleType></xs:element><xs:element name="ValDecDou" minOccurs="0"><xs:annotation><xs:documentation>Valeur Douane En Centimes</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string009"><xs:pattern value="[0-9]{9}" /></xs:restriction></xs:simpleType></xs:element><xs:element name="ValDevDou" minOccurs="0" default="EUR"><xs:annotation><xs:documentation>Devise valeur Douane</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string003"><xs:enumeration value="EUR" /></xs:restriction></xs:simpleType></xs:element><xs:element name="ValDecRep" minOccurs="0"><xs:annotation><xs:documentation>Valeur déclarée CRBT En Centimes</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string009"><xs:pattern value="[0-9]{9}" /></xs:restriction></xs:simpleType></xs:element><xs:element name="ValDevRep" minOccurs="0" default="EUR"><xs:annotation><xs:documentation>Devise valeur déclarée CRBT</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string003"><xs:enumeration value="EUR" /></xs:restriction></xs:simpleType></xs:element><xs:element name="TypeRep" minOccurs="0"><xs:annotation><xs:documentation>Type de REP (Aller ou Retour) Ou bien  Type du SWAP déclaré (Aller ou Retour)
Valeur par défaut à vide.
SWPA = SWAP Aller, SWPR = SWAP Retour
REPA = REP Aller, REPR = REP Retour
</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string004"><xs:enumeration value="" /><xs:enumeration value="SWPA" /><xs:enumeration value="SWPR" /><xs:enumeration value="REPA" /><xs:enumeration value="REPR" /></xs:restriction></xs:simpleType></xs:element><xs:element name="RepRet" minOccurs="0"><xs:annotation><xs:documentation>N° Chronopost du  REP ou du SWAP retour
Si le colis déclaré est un SWAP Aller, indiquer ici le N° du Retour. Si le colis déclaré est un REP Aller, indiquer ici le N° du Retour.</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string013" /></xs:simpleType></xs:element><xs:element name="RepDep" minOccurs="0"><xs:annotation><xs:documentation>N° Chronopost du  REP ou du SWAP aller
Si le colis déclaré est un SWAP Retour, indiquer ici le N° du Aller. Si le colis déclaré est un REP Retour, indiquer ici le N° du Aller
</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string013" /></xs:simpleType></xs:element><xs:element name="CptPart" type="eltyp_string045" minOccurs="0"><xs:annotation><xs:documentation>information fourni par Chronopost</xs:documentation></xs:annotation></xs:element><xs:element name="DatDebRdv" type="Eltyp_DateAAAAMMJJHHMM" minOccurs="0"><xs:annotation><xs:documentation> Date de début de rendez-vous Sous la forme AAAAMMJJHHMM Uniquement pour les produits à livraison sur RDV</xs:documentation></xs:annotation></xs:element><xs:element name="DatFinRdv" type="Eltyp_DateAAAAMMJJHHMM" minOccurs="0"><xs:annotation><xs:documentation> Date de fin de rendez-vous Sous la forme AAAAMMJJHHMM Uniquement pour les produits à livraison sur RDV</xs:documentation></xs:annotation></xs:element><xs:element name="LivExpVen" minOccurs="0" default="A"><xs:annotation><xs:documentation>Jour de livraison souhaité pour les envois du vendredi
0 : Normal ,1: Lundi, 2: Mardi, 3: Mercredi, 4: Jeudi, 5: Vend et 6: Samedi
« A » Déterminé par Mutualisation Expédition
</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string001"><xs:enumeration value="0" /><xs:enumeration value="1" /><xs:enumeration value="2" /><xs:enumeration value="3" /><xs:enumeration value="4" /><xs:enumeration value="5" /><xs:enumeration value="6" /><xs:enumeration value="A" /></xs:restriction></xs:simpleType></xs:element><xs:element name="GpsLivLat" type="eltyp_string045" minOccurs="0"><xs:annotation><xs:documentation>Coordonnées GPS du point à livrer : Latitude </xs:documentation></xs:annotation></xs:element><xs:element name="GpsLivLon" type="eltyp_string045" minOccurs="0"><xs:annotation><xs:documentation>Coordonnées GPS du point à livrer : Longitude </xs:documentation></xs:annotation></xs:element><xs:element name="InstPart1" type="eltyp_string045" minOccurs="0"><xs:annotation><xs:documentation>Informations libre émetteur</xs:documentation></xs:annotation></xs:element><xs:element name="InstPart2" type="eltyp_string045" minOccurs="0"><xs:annotation><xs:documentation>Informations libre émetteur</xs:documentation></xs:annotation></xs:element><xs:element name="NumCR" type="eltyp_string011" minOccurs="0"><xs:annotation><xs:documentation>Informations libre émetteur</xs:documentation></xs:annotation></xs:element><xs:element name="MonTransHT" minOccurs="0"><xs:annotation><xs:documentation>Montant du transport HT  En Centimes</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string009"><xs:pattern value="[0-9]{9}" /></xs:restriction></xs:simpleType></xs:element><xs:element name="MonTransTTC" minOccurs="0"><xs:annotation><xs:documentation>Montant du transport TTC En Centimes</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string009"><xs:pattern value="[0-9]{9}" /></xs:restriction></xs:simpleType></xs:element><xs:element name="MonTransTVA" minOccurs="0"><xs:annotation><xs:documentation>Montant du transport TVA En Centimes</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string009"><xs:pattern value="[0-9]{9}" /></xs:restriction></xs:simpleType></xs:element><xs:element name="ValDevTrans" minOccurs="0" default="EUR"><xs:annotation><xs:documentation>Devise valeur Assurance</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="eltyp_string003"><xs:enumeration value="EUR" /></xs:restriction></xs:simpleType></xs:element><xs:element name="RefSwap" type="eltyp_string045" minOccurs="0"><xs:annotation><xs:documentation>Référence SWAP</xs:documentation></xs:annotation></xs:element><xs:element name="NumColEmet" type="eltyp_string035" minOccurs="0"><xs:annotation><xs:documentation>N° interne du colis chez l'émetteur Ligne à disposition émetteur</xs:documentation></xs:annotation></xs:element><xs:element name="RefExp" type="eltyp_string035" minOccurs="0"><xs:annotation><xs:documentation>Référence Expéditeur Ligne à disposition émetteur</xs:documentation></xs:annotation></xs:element></xs:sequence></xs:complexType></xs:element></xs:schema>
and common.xsd is :
<?xml version="1.0" encoding="utf-8" ?><!--Created with Liquid XML 2015 Designer Edition 13.1.0.5909 (http://www.liquid-technologies.com)--><!--Version 1.0.1 du 24/06/2015  --><!--Version 1.0.2 du 07/07/2015  --><!--Version 1.0.3 du 16/07/2015  --><!--Version 1.0.4 du 21/07/2015  - Correction liste des trans/modtrans/Col --><xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"><!--Element De base --></xs:simpleType><xs:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="eltyp_string032"><xsd:restriction base="xsd:string"><xsd:maxLength value="32" /></xsd:restriction></xs:simpleType><xs:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="eltyp_string035"><xsd:restriction base="xsd:string"><xsd:maxLength value="35" /></xsd:restriction></xs:simpleType></xs:schema><!--Fin des ꭩments de type complexes-->
Why the main.xsd is not able to get the declaration of "eltyp_string035"

Validate xml file against multiple XSD files

$
0
0

Hi

I have top validate an xml file against multiple xsd files. These files have herirarchy. There is one root file that reference another two files. How can i validate them? 

XML serialize deserialization

$
0
0

Respected Experts,

I had been using 

DatasetMyDs.ReadXmlSchema( @"\Export\Tally.XSD");

and populate this data Tables and and the end

DataSetMyDs.WriteXml(FD.FileName)

it was all ok. but now i have to transfer Item Masters From SQL Tables To Popular Indian accounting software Tally whose Item Master and its associate table XML is attached here with 

<ENVELOPE><HEADER><TALLYREQUEST>Import Data</TALLYREQUEST></HEADER><BODY><IMPORTDATA><REQUESTDESC><REPORTNAME>All Masters</REPORTNAME><STATICVARIABLES><SVCURRENTCOMPANY>Auto Corner 2015-2016</SVCURRENTCOMPANY></STATICVARIABLES></REQUESTDESC><REQUESTDATA><TALLYMESSAGE xmlns:UDF="TallyUDF"><UNIT NAME="Ltr" RESERVEDNAME=""><NAME>Ltr</NAME><ORIGINALSYMBOL>Liter</ORIGINALSYMBOL><ISSIMPLEUNIT>Yes</ISSIMPLEUNIT><DECIMALPLACES> 3</DECIMALPLACES></UNIT></TALLYMESSAGE><TALLYMESSAGE xmlns:UDF="TallyUDF"><UNIT NAME="No" RESERVEDNAME=""><NAME>No</NAME><ORIGINALSYMBOL>Number</ORIGINALSYMBOL><ISSIMPLEUNIT>Yes</ISSIMPLEUNIT></UNIT></TALLYMESSAGE><TALLYMESSAGE xmlns:UDF="TallyUDF"><CURRENCY NAME="Rs." RESERVEDNAME=""><MAILINGNAME>Indian Rupees</MAILINGNAME><EXPANDEDSYMBOL>Indian Rupees</EXPANDEDSYMBOL><DECIMALSYMBOL>paise</DECIMALSYMBOL><ORIGINALSYMBOL>Rs.</ORIGINALSYMBOL><ISSUFFIX>No</ISSUFFIX><HASSPACE>Yes</HASSPACE><INMILLIONS>No</INMILLIONS><DECIMALPLACES> 2</DECIMALPLACES><DECIMALPLACESFORPRINTING> 2</DECIMALPLACESFORPRINTING></CURRENCY></TALLYMESSAGE><TALLYMESSAGE xmlns:UDF="TallyUDF"><CURRENCY NAME="Rs." RESERVEDNAME=""><MAILINGNAME>Indian Rupees</MAILINGNAME><EXPANDEDSYMBOL>Indian Rupees</EXPANDEDSYMBOL><DECIMALSYMBOL>paise</DECIMALSYMBOL><ORIGINALSYMBOL>Rs.</ORIGINALSYMBOL><ISSUFFIX>No</ISSUFFIX><HASSPACE>Yes</HASSPACE><INMILLIONS>No</INMILLIONS><DECIMALPLACES> 2</DECIMALPLACES><DECIMALPLACESFORPRINTING> 2</DECIMALPLACESFORPRINTING></CURRENCY></TALLYMESSAGE><TALLYMESSAGE xmlns:UDF="TallyUDF"><GODOWN NAME="Main Location" RESERVEDNAME=""><PARENT/><JOBNAME/><HASNOSPACE>No</HASNOSPACE><HASNOSTOCK>No</HASNOSTOCK><LANGUAGENAME.LIST><NAME.LIST TYPE="String"><NAME>Main Location</NAME></NAME.LIST><LANGUAGEID> 1033</LANGUAGEID></LANGUAGENAME.LIST><SERIALNUMBERLIST.LIST>      </SERIALNUMBERLIST.LIST></GODOWN></TALLYMESSAGE><TALLYMESSAGE xmlns:UDF="TallyUDF"><STOCKITEM NAME="M.S." RESERVEDNAME=""><PARENT/><CATEGORY/><TAXCLASSIFICATIONNAME/><COSTINGMETHOD>Avg. Cost</COSTINGMETHOD><VALUATIONMETHOD>Avg. Price</VALUATIONMETHOD><BASEUNITS>Ltr</BASEUNITS><ADDITIONALUNITS/><ISCOSTCENTRESON>No</ISCOSTCENTRESON><ISBATCHWISEON>No</ISBATCHWISEON><ISPERISHABLEON>No</ISPERISHABLEON><IGNOREPHYSICALDIFFERENCE>No</IGNOREPHYSICALDIFFERENCE><IGNORENEGATIVESTOCK>No</IGNORENEGATIVESTOCK><TREATSALESASMANUFACTURED>No</TREATSALESASMANUFACTURED><TREATPURCHASESASCONSUMED>No</TREATPURCHASESASCONSUMED><TREATREJECTSASSCRAP>No</TREATREJECTSASSCRAP><HASMFGDATE>No</HASMFGDATE><ALLOWUSEOFEXPIREDITEMS>No</ALLOWUSEOFEXPIREDITEMS><IGNOREBATCHES>No</IGNOREBATCHES><IGNOREGODOWNS>No</IGNOREGODOWNS><EXCLUDEJRNLFORVALUATION>No</EXCLUDEJRNLFORVALUATION><ISMRPINCLOFTAX>No</ISMRPINCLOFTAX><ISADDLTAXEXEMPT>No</ISADDLTAXEXEMPT><ISSUPPLEMENTRYDUTYON>No</ISSUPPLEMENTRYDUTYON><REORDERASHIGHER>No</REORDERASHIGHER><MINORDERASHIGHER>No</MINORDERASHIGHER><DENOMINATOR> 1</DENOMINATOR><RATEOFVAT>0</RATEOFVAT><LANGUAGENAME.LIST><NAME.LIST TYPE="String"><NAME>M.S.</NAME><NAME>2-1</NAME></NAME.LIST><LANGUAGEID> 1033</LANGUAGEID></LANGUAGENAME.LIST><ADDITIONALLEDGERS.LIST>      </ADDITIONALLEDGERS.LIST><EXCISEITEMGODOWN.LIST><EXCISEBOM.LIST>       </EXCISEBOM.LIST><EXCISEDUTIES.LIST>       </EXCISEDUTIES.LIST></EXCISEITEMGODOWN.LIST></STOCKITEM></TALLYMESSAGE></REQUESTDATA></IMPORTDATA></BODY></ENVELOPE>

Tally accounting system does not have id concept it all depend on name of ledgers but they have provision for Alias for ledgers

so in above case For Item M.S.( motor Spirit i.e petrol)  its SQL Table Have id as 2-1 i want to transfer both name and alias so i can not escape there schema.

what should be the way to serialize it. I tried Making XSD , XSD With XSD /d, XSD /C etc. but due to 

<LANGUAGENAME.LIST><NAME.LIST TYPE="String">

Name appearing Twice It is getting Failed. 

there are other parties who are writing them successfully.  

what i would be missing in doing it can you please suggest how to do it ,

Thanks a lot.

"Generate sample XML" in VS2013 is buggy?

$
0
0

Hello experts,

I use VS Community 2013 update 5 for working with complex XSD schemas.

It seems that "generate sample XML" contains a bug that will exclude valid elements, in case other elements with same names have been used before in the resulting XML file.

Below are two generated XML samples, second one being subset of the first one. Check the content of <CVPerson>, valid elements <ID> and <Name> are present in second sample, but are missing in first, probably because <ID> and <Name> have been used in <UBLExtension> nodes.

Also, elements <InstitutionPlaceOfStayLegalEntity>, <HealthCareProviderLegalEntity>, <CompetentInstitutionLegalEntity>

in the end of first sample, are of the same type and should have same subelements, which is not the case.

Am I making sense, is it a bug or I am missing something?

<?xml version="1.0" encoding="utf-8"?><PRCRequest xmlns="urn:e-SENS:e-Confirmation:prc:xsd:PRCRequest"><UBLExtensions xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"><UBLExtension><ID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ID1</ID><Name languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Name1</Name><ExtensionAgencyID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1">ExtensionAgencyID1</ExtensionAgencyID><ExtensionAgencyName languageID="en" languageLocaleID="languageLocaleID1">ExtensionAgencyName1</ExtensionAgencyName><ExtensionVersionID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1">ExtensionVersionID1</ExtensionVersionID><ExtensionAgencyURI schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1">ExtensionAgencyURI1</ExtensionAgencyURI><ExtensionURI schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1">ExtensionURI1</ExtensionURI><ExtensionReasonCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1">ExtensionReasonCode1</ExtensionReasonCode><ExtensionReason languageID="en" languageLocaleID="languageLocaleID1">ExtensionReason1</ExtensionReason><ExtensionContent><any_element xmlns="otherNS">anyType</any_element></ExtensionContent></UBLExtension><UBLExtension><ID schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ID2</ID><Name languageID="fr" languageLocaleID="languageLocaleID2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Name2</Name><ExtensionAgencyID schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2">ExtensionAgencyID2</ExtensionAgencyID><ExtensionAgencyName languageID="fr" languageLocaleID="languageLocaleID2">ExtensionAgencyName2</ExtensionAgencyName><ExtensionVersionID schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2">ExtensionVersionID2</ExtensionVersionID><ExtensionAgencyURI schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2">ExtensionAgencyURI2</ExtensionAgencyURI><ExtensionURI schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2">ExtensionURI2</ExtensionURI><ExtensionReasonCode listID="listID2" listAgencyID="listAgencyID2" listAgencyName="listAgencyName2" listName="listName2" listVersionID="listVersionID2" name="name2" languageID="fr" listURI="http://uri2" listSchemeURI="http://uri2">ExtensionReasonCode2</ExtensionReasonCode><ExtensionReason languageID="fr" languageLocaleID="languageLocaleID2">ExtensionReason2</ExtensionReason><ExtensionContent><any_element xmlns="otherNS">anyType</any_element></ExtensionContent></UBLExtension><UBLExtension><ID schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ID3</ID><Name languageID="de" languageLocaleID="languageLocaleID3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Name3</Name><ExtensionAgencyID schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3">ExtensionAgencyID3</ExtensionAgencyID><ExtensionAgencyName languageID="de" languageLocaleID="languageLocaleID3">ExtensionAgencyName3</ExtensionAgencyName><ExtensionVersionID schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3">ExtensionVersionID3</ExtensionVersionID><ExtensionAgencyURI schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3">ExtensionAgencyURI3</ExtensionAgencyURI><ExtensionURI schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3">ExtensionURI3</ExtensionURI><ExtensionReasonCode listID="listID3" listAgencyID="listAgencyID3" listAgencyName="listAgencyName3" listName="listName3" listVersionID="listVersionID3" name="name3" languageID="de" listURI="http://uri3" listSchemeURI="http://uri3">ExtensionReasonCode3</ExtensionReasonCode><ExtensionReason languageID="de" languageLocaleID="languageLocaleID3">ExtensionReason3</ExtensionReason><ExtensionContent><any_element xmlns="otherNS">anyType</any_element></ExtensionContent></UBLExtension></UBLExtensions><UBLVersionID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">UBLVersionID1</UBLVersionID><CustomizationID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">CustomizationID1</CustomizationID><ProfileID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ProfileID1</ProfileID><ProfileExecutionID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ProfileExecutionID1</ProfileExecutionID><UUID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">UUID1</UUID><IssueDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</IssueDate><IssueTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</IssueTime><PersonConsentCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">PersonConsentCode1</PersonConsentCode><RequestedValidityPeriod xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"><StartDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</StartDate><StartTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</StartTime><EndDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</EndDate><EndTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</EndTime><DurationMeasure unitCode="unitCode1" unitCodeListVersionID="unitCodeListVersionID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1</DurationMeasure><DescriptionCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode1</DescriptionCode><DescriptionCode listID="listID2" listAgencyID="listAgencyID2" listAgencyName="listAgencyName2" listName="listName2" listVersionID="listVersionID2" name="name2" languageID="fr" listURI="http://uri2" listSchemeURI="http://uri2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode2</DescriptionCode><DescriptionCode listID="listID3" listAgencyID="listAgencyID3" listAgencyName="listAgencyName3" listName="listName3" listVersionID="listVersionID3" name="name3" languageID="de" listURI="http://uri3" listSchemeURI="http://uri3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode3</DescriptionCode><Description languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description1</Description><Description languageID="fr" languageLocaleID="languageLocaleID2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description2</Description><Description languageID="de" languageLocaleID="languageLocaleID3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description3</Description></RequestedValidityPeriod><InsuredPerson xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents"><DocumentTypeCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DocumentTypeCode1</DocumentTypeCode><DocumentID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DocumentID1</DocumentID><DocumentExpiryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</DocumentExpiryDate><InsuranceID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">InsuranceID1</InsuranceID><EuropeanHealthInsuranceCardID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">EuropeanHealthInsuranceCardID1</EuropeanHealthInsuranceCardID><EuropeanHealthInsuranceCardExpiryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</EuropeanHealthInsuranceCardExpiryDate><CertificateDeliveryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</CertificateDeliveryDate><CertificateValidityPeriod /><CVPerson><BirthName languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">BirthName1</BirthName><FamilyName languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">FamilyName1</FamilyName><GivenName languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">GivenName1</GivenName><BirthDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</BirthDate></CVPerson></InsuredPerson><InstitutionPlaceOfStayLegalEntity xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents"><LegalID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">LegalID1</LegalID><RegisteredCVAddress><AdminunitFirstline languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">AdminunitFirstline1</AdminunitFirstline></RegisteredCVAddress></InstitutionPlaceOfStayLegalEntity><HealthCareProviderLegalEntity xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents" /><CompetentInstitutionLegalEntity xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents" /></PRCRequest>


<?xml version="1.0" encoding="utf-8"?><InsuredPerson xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents"><DocumentTypeCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DocumentTypeCode1</DocumentTypeCode><DocumentID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DocumentID1</DocumentID><DocumentExpiryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</DocumentExpiryDate><InsuranceID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">InsuranceID1</InsuranceID><EuropeanHealthInsuranceCardID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">EuropeanHealthInsuranceCardID1</EuropeanHealthInsuranceCardID><EuropeanHealthInsuranceCardExpiryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</EuropeanHealthInsuranceCardExpiryDate><CertificateDeliveryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</CertificateDeliveryDate><CertificateValidityPeriod><StartDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</StartDate><StartTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</StartTime><EndDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</EndDate><EndTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</EndTime><DurationMeasure unitCode="unitCode1" unitCodeListVersionID="unitCodeListVersionID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1</DurationMeasure><DescriptionCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode1</DescriptionCode><DescriptionCode listID="listID2" listAgencyID="listAgencyID2" listAgencyName="listAgencyName2" listName="listName2" listVersionID="listVersionID2" name="name2" languageID="fr" listURI="http://uri2" listSchemeURI="http://uri2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode2</DescriptionCode><DescriptionCode listID="listID3" listAgencyID="listAgencyID3" listAgencyName="listAgencyName3" listName="listName3" listVersionID="listVersionID3" name="name3" languageID="de" listURI="http://uri3" listSchemeURI="http://uri3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode3</DescriptionCode><Description languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description1</Description><Description languageID="fr" languageLocaleID="languageLocaleID2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description2</Description><Description languageID="de" languageLocaleID="languageLocaleID3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description3</Description></CertificateValidityPeriod><CVPerson><BirthName languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">BirthName1</BirthName><FamilyName languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">FamilyName1</FamilyName><GivenName languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">GivenName1</GivenName><Name languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Name1</Name><BirthDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</BirthDate><ID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ID1</ID></CVPerson></InsuredPerson>


Viewing all 935 articles
Browse latest View live


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