|
Ignore previous. The better way to do this is with xmllint:
[k5054@localhost]$ xmllint --xpath "string(//debarm/@url)" data.xml
https://downloads.lms-community.org/nightly/logitechmediaserver_8.5.2~1715233151_arm.deb
[k5054@localhost]$
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown
|
|
|
|
|
I just discovered this about a minute before you posted - thanks for your time
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Jackson does not provide a tool for generating Jackson classes from XSD or JSON, as JAXB does for a specific XSD.
The JAXB class generator was used to generate a set of classes for the specified XSD schema. For polymorphic types, for example, JAXB provides the following annotation to identify the name based on the name of an XML element.
@XmlElements({
@XmlElement(name = "Dog", type = Dog.class),
@XmlElement(name = "Cat", type = Cat.class)
})
protected List<Animal> animal; Can such courses be offered in Jackson? Specifically, determining the type based on the name of an XML element.
|
|
|
|
|
Hi All,
There is a query for which i am seeing assistance, on how to group the XML by keyElements using XSLT. Below is the sample XML code: -
<pre lang="XML"><?xml version = "1.0" encoding = "UTF-8"?>
<CISDocument>
<Aheader>
<OperationName>APINAME</OperationName>
</Aheader>
<ResponseHeader>
<CompletedSuccessfully>true</CompletedSuccessfully>
</ResponseHeader>
<Page>
<StartAtRow>0</StartAtRow>
<MaxRows>5</MaxRows>
<TotalRowCount>1</TotalRowCount>
</Page>
<Entity>
<Load>
<LID>A</LID>
<ccode>B</ccode>
<servicecode>C</servicecode>
<flocationcode>D</flocationcode>
<llocationcode>E</llocationcode>
<BaseShipmentModule>
<ShipUnitModule>
<Shnum>1234567</Shnum>
<Sfromlocation>01234</Sfromlocation>
<Stolocation>04567</Stolocation>
<Container>
<SContainerID>1</SContainerID>
<Quantity>1</Quantity>
<ContainerVinformation>
<Volume>1</Volume>
</ContainerVinformation>
<ItemNumber>AA</ItemNumber>
<WFClass>
<Fweigth>222</Fweigth>
<FClassCode>10</FClassCode>
</WFClass>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>BBB</ReferenceNumberTypeCode>
<ReferenceNumber>CCC</ReferenceNumber>
</ReferenceNumberStructure>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>DDD</ReferenceNumberTypeCode>
<ReferenceNumber>1233</ReferenceNumber>
</ReferenceNumberStructure>
</Container>
</ShipUnitModule>
</BaseShipmentModule>
<BaseShipmentModule>
<ShipUnitModule>
<Shnum>1234568</Shnum>
<Sfromlocation>01234</Sfromlocation>
<Stolocation>04567</Stolocation>
<Container>
<SContainerID>1</SContainerID>
<Quantity>1</Quantity>
<ContainerVinformation>
<Volume>1</Volume>
</ContainerVinformation>
<ItemNumber>AA</ItemNumber>
<WFClass>
<Fweigth>222</Fweigth>
<FClassCode>10</FClassCode>
</WFClass>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>BBB</ReferenceNumberTypeCode>
<ReferenceNumber>CCC</ReferenceNumber>
</ReferenceNumberStructure>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>DDD</ReferenceNumberTypeCode>
<ReferenceNumber>1233</ReferenceNumber>
</ReferenceNumberStructure>
</Container>
</ShipUnitModule>
</BaseShipmentModule>
<BaseShipmentModule>
<ShipUnitModule>
<Shnum>1234569</Shnum>
<Sfromlocation>11234</Sfromlocation>
<Stolocation>14567</Stolocation>
<Container>
<SContainerID>1</SContainerID>
<Quantity>1</Quantity>
<ContainerVinformation>
<Volume>1</Volume>
</ContainerVinformation>
<ItemNumber>AA</ItemNumber>
<WFClass>
<Fweigth>222</Fweigth>
<FClassCode>10</FClassCode>
</WFClass>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>BBB</ReferenceNumberTypeCode>
<ReferenceNumber>CCC</ReferenceNumber>
</ReferenceNumberStructure>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>DDD</ReferenceNumberTypeCode>
<ReferenceNumber>1233</ReferenceNumber>
</ReferenceNumberStructure>
</Container>
</ShipUnitModule>
</BaseShipmentModule>
<BaseShipmentModule>
<ShipUnitModule>
<Shnum>1234570</Shnum>
<Sfromlocation>11234</Sfromlocation>
<Stolocation>14567</Stolocation>
<Container>
<SContainerID>1</SContainerID>
<Quantity>1</Quantity>
<ContainerVinformation>
<Volume>1</Volume>
</ContainerVinformation>
<ItemNumber>AA</ItemNumber>
<WFClass>
<Fweigth>222</Fweigth>
<FClassCode>10</FClassCode>
</WFClass>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>BBB</ReferenceNumberTypeCode>
<ReferenceNumber>CCC</ReferenceNumber>
</ReferenceNumberStructure>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>DDD</ReferenceNumberTypeCode>
<ReferenceNumber>1233</ReferenceNumber>
</ReferenceNumberStructure>
</Container>
</ShipUnitModule>
</BaseShipmentModule>
<S1>
<SID>1613243
</SSID>
<SCount>3</SCount>
<CDStop>0</CDStop>
<AATime>2022-06-17T08:00:00</AATime>
<SLCode>06V0018963</SLCode>
</S1>
<S1>
<SSID>1613244</SSID>
<SCount>0</SCount>
<CDStop>16</CDStop>
<AATime>2022-06-17T19:45:00</AATime>
<SLCode>06C0124A</SLCode>
</S1>
<S1>
<SSID>1613245</SSID>
<SCount>4</SCount>
<CDStop>0</CDStop>
<AATime>2022-06-17T09:00:00</AATime>
<SLCode>06V0029699</SLCode>
</S1>
</Stop>
</Load>
</Entity>
As we can see in the above XML example, there are multiple <baseshipmentmodule> tag and within each <baseshipmentmodule> we have a tag called: <sfromlocation> and <stolocation> which stands for location code, from and to location.
Now if we observe a little bit, we have a total of 4 <baseshipmentmodule> tag and the value for <sfromlocation> and <stolocation> in same in the 1st and 2nd <baseshipmentmodule> tag. Where as the value for <sfromlocation> and <stolocation> is same in the 3rd and 4th <baseshipmentmodule> tag. Looking for to group the XML based on the <sfromlocation> and <stolocation>.
Expected output is shown below: -
= "1.0"= "UTF-8"
<CISDocument>
<Aheader>
<OperationName>APINAME</OperationName>
</Aheader>
<ResponseHeader>
<CompletedSuccessfully>true</CompletedSuccessfully>
</ResponseHeader>
<Page>
<StartAtRow>0</StartAtRow>
<MaxRows>5</MaxRows>
<TotalRowCount>1</TotalRowCount>
</Page>
<Entity>
<Load>
<LID>A</LID>
<ccode>B</ccode>
<servicecode>C</servicecode>
<flocationcode>D</flocationcode>
<llocationcode>E</llocationcode>
<BaseShipmentModule>
<ShipUnitModule>
<Shnum>1234567</Shnum>
<Shnum>1234568</Shnum>
<Sfromlocation>01234</Sfromlocation>
<Stolocation>04567</Stolocation>
<Container>
<SContainerID>1</SContainerID>
<Quantity>1</Quantity>
<ContainerVinformation>
<Volume>1</Volume>
</ContainerVinformation>
<ItemNumber>AA</ItemNumber>
<WFClass>
<Fweigth>222</Fweigth>
<FClassCode>10</FClassCode>
</WFClass>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>BBB</ReferenceNumberTypeCode>
<ReferenceNumber>CCC</ReferenceNumber>
</ReferenceNumberStructure>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>DDD</ReferenceNumberTypeCode>
<ReferenceNumber>1233</ReferenceNumber>
</ReferenceNumberStructure>
</Container>
<Container>
<SContainerID>1</SContainerID>
<Quantity>1</Quantity>
<ContainerVinformation>
<Volume>1</Volume>
</ContainerVinformation>
<ItemNumber>AA</ItemNumber>
<WFClass>
<Fweigth>222</Fweigth>
<FClassCode>10</FClassCode>
</WFClass>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>BBB</ReferenceNumberTypeCode>
<ReferenceNumber>CCC</ReferenceNumber>
</ReferenceNumberStructure>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>DDD</ReferenceNumberTypeCode>
<ReferenceNumber>1233</ReferenceNumber>
</ReferenceNumberStructure>
</Container>
</ShipUnitModule>
</BaseShipmentModule>
<BaseShipmentModule>
<ShipUnitModule>
<Shnum>1234569</Shnum>
<Shnum>1234570</Shnum>
<Sfromlocation>11234</Sfromlocation>
<Stolocation>14567</Stolocation>
<Container>
<SContainerID>1</SContainerID>
<Quantity>1</Quantity>
<ContainerVinformation>
<Volume>1</Volume>
</ContainerVinformation>
<ItemNumber>AA</ItemNumber>
<WFClass>
<Fweigth>222</Fweigth>
<FClassCode>10</FClassCode>
</WFClass>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>BBB</ReferenceNumberTypeCode>
<ReferenceNumber>CCC</ReferenceNumber>
</ReferenceNumberStructure>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>DDD</ReferenceNumberTypeCode>
<ReferenceNumber>1233</ReferenceNumber>
</ReferenceNumberStructure>
</Container>
<Container>
<SContainerID>1</SContainerID>
<Quantity>1</Quantity>
<ContainerVinformation>
<Volume>1</Volume>
</ContainerVinformation>
<ItemNumber>AA</ItemNumber>
<WFClass>
<Fweigth>222</Fweigth>
<FClassCode>10</FClassCode>
</WFClass>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>BBB</ReferenceNumberTypeCode>
<ReferenceNumber>CCC</ReferenceNumber>
</ReferenceNumberStructure>
<ReferenceNumberStructure>
<ReferenceNumberTypeCode>DDD</ReferenceNumberTypeCode>
<ReferenceNumber>1233</ReferenceNumber>
</ReferenceNumberStructure>
</Container>
</ShipUnitModule>
</BaseShipmentModule>
<S1>
<SID>1613243
</SSID>
<SCount>3</SCount>
<CDStop>0</CDStop>
<AATime>2022-06-17T08:00:00</AATime>
<SLCode>06V0018963</SLCode>
</S1>
<S1>
<SSID>1613244</SSID>
<SCount>0</SCount>
<CDStop>16</CDStop>
<AATime>2022-06-17T19:45:00</AATime>
<SLCode>06C0124A</SLCode>
</S1>
<S1>
<SSID>1613245</SSID>
<SCount>4</SCount>
<CDStop>0</CDStop>
<AATime>2022-06-17T09:00:00</AATime>
<SLCode>06V0029699</SLCode>
</S1>
</Stop>
</Load>
</Entity>
As we can see in the above result, we have combined the <shipunitmodule> based on the <sfromlocation> and <stolocation> tag. And he tag <container> has been grouped and the rest of the tag <s1> is unaffected by it. We did get help from one of the Engineers (Michael), with the below XSLT,
<xsl:stylesheet version="2.0" xmlns:xsl=http://www.w3.org/1999/XSL/Transform>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/Entity">
<xsl:copy>
<xsl:for-each-group select="Shipment" group-by="concat(shipFromLocation, '|', shipToLocation)">
<Shipment>
<xsl:copy-of select="shipFromLocation, shipToLocation"/>
<xsl:copy-of select="current-group()/container"/>
</Shipment>
</xsl:for-each-group>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
But, it is not able to help the overall output, please do help us here. Its quite important. Any suggestion will matter a lot.
|
|
|
|
|
Trying display the languages in an unordered list (what I want it to display- scroll to the bottom). Sorry for the bad format.
XML FILE
<?xml version="1.0"?>
<!-- linking this XML document with a style sheet -->
<?xml-stylesheet type="text/xsl" href="page1.xsl" ?>
<Continents>
<Continent>
<name>America</name>
<Languages>
<Language>English</Language>
<Language>Spanish</Language>
<Language>Portuguese</Language>
<Language>French</Language>
<Language>Dutch</Language>
<Language>Criolo</Language>
</Languages>
</Continent>
<Continent>
<name>Europe</name>
<Languages>
<Language>Portuguese</Language>
<Language>Spanish</Language>
<Language>English</Language>
<Language>German</Language>
</Languages>
</Continent>
XSL FILE
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match = "/"> <!-- root template -->
<html>
<head><title>Continents</title></head>
<body>
<xsl:for-each select="Continents/Continent">
Continent:
<xsl:value-of select="name" />
<p>Languages:</p>
<ul>
<li><xsl:value-of select="Languages" /></li>
</ul>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The code above displays:
Continent: America
Languages:
English Spanish Portuguese French Dutch Criolo
Continent: Europe
Languages:
Portuguese Spanish English German
The desired output is:
Continent: America
Languages:
English
Spanish
Portuguese
French
Dutch
Criolo
Continent: Europe
Languages:
Portuguese
Spanish
English
German
So how can I make it to display the child element <language> in a unordered list?
|
|
|
|
|
Need Nested Loop.
="1.0"
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match = "/">
<html>
<head><title>Continents</title></head>
<body>
<xsl:for-each select="Continents/Continent">
Continent:
<xsl:value-of select="name" />
<p>Languages:</p>
<ul>
<xsl:for-each select="Languages/Language">
<li><xsl:value-of select="." /></li>
</xsl:for-each>
</ul>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Output:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Continents</title>
</head>
<body>
Continent:
America
<p>Languages:</p>
<ul>
<li>English</li>
<li>Spanish</li>
<li>Portuguese</li>
<li>French</li>
<li>Dutch</li>
<li>Criolo</li>
</ul>
Continent:
Europe
<p>Languages:</p>
<ul>
<li>Portuguese</li>
<li>Spanish</li>
<li>English</li>
<li>German</li>
</ul>
</body>
</html>
|
|
|
|
|
Hello,
I have a xsl style sheet that transforms xml file.
<xsl:if test="not(Payer/Address/County='') or not(Payer/Address/State='') or not(Payer/Address/Province='')">
<CtrySubDvsn>
<xsl:value-of select="Payer/Address/County" />
<xsl:value-of select="Payer/Address/State" />
<xsl:value-of select="Payer/Address/Province" />
</CtrySubDvsn>
</xsl:if>
When one or more of attributes has value, concatenated value becomes data for <ctrysubdvsn>. However, if all 3 attributes in 'if' are null, it is returning
<CtrySubDvsn/> .
How would I modify the 'if' to NOT return tag when it has no value?
|
|
|
|
|
Use switch statement. Create one when for all null.
<xsl:choose>
<xsl:when test="not(Payer/Address/County='') and not(Payer/Address/State='') and not(Payer/Address/Province='')">
</xsl:when>
<xsl:when test="not(Payer/Address/County='') or not(Payer/Address/State='') or not(Payer/Address/Province='')">
<CtrySubDvsn>
<xsl:value-of select="Payer/Address/County" />
<xsl:value-of select="Payer/Address/State" />
<xsl:value-of select="Payer/Address/Province" />
</CtrySubDvsn>
</xsl:when>
</xsl:choose>
|
|
|
|
|
Hi Friends,
I have a scenario where need to generate WordProcessing Report
Here is my template sample below
First Name: «FirstName»
Last Name: «LastName»
Here First Name and Last Name are keys and corresponding Merge-fields are («FirstName» & «LastName»)
Now I have to generate a report where these key and merge-fields need to repeat number of times according to the Employee record. Example if there are fice employees in database, i need to show all five employees record one after other with FirstName and LastName in sequence.
I tried with below code. But this wont help because the key and data value does not show as per template configuration.
Can you please tell me how can i achieve this in C#?
Thanks in advance.
|
|
|
|
|
I have two elements in a XSLT
"/glcim:lcim/glcim:applicant-details/glcim:applicant-reference"
and
"/glcim:lcim/glcim:applicant-details/glcim:applicant-reference_new"
I want to compare the value of these two elements and if they differ in value
i want to populate the value of glcim:applicant-reference_new into ApplicationId field
can i get an XSLT code for it please
Right now I have
<xsl:text> "RefId":"</xsl:text>
<xsl:value-of select="/glcim:lcim/glcim:applicant-details/glcim:applicant-reference"/>
<xsl:text>",</xsl:text>
which populates the RefId with the value of /glcim:lcim/glcim:applicant-details/glcim:applicant-reference
But I would like to populate RefId with "/glcim:lcim/glcim:applicant-details/glcim:applicant-reference_new"
only if the values of glcim:applicant-reference_new differ from glcim:applicant-reference else Skip populating the Refid
ANy XSLT code would be greatly appreciated
|
|
|
|
|
Try:
<xsl:if test="/glcim:lcim/glcim:applicant-details/glcim:applicant-reference != /glcim:lcim/glcim:applicant-details/glcim:applicant-reference_new">
<xsl:text>"RefId":"</xsl:text>
<xsl:value-of select="/glcim:lcim/glcim:applicant-details/glcim:applicant-reference_new" />
<xsl:text>",</xsl:text>
</xsl:if> <xsl:if> Element | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
when i opened the app, i dont see any webbrowser on my screen help! i just put a webbrowser.. no coding wwhy is it hidden??? i have check all!
|
|
|
|
|
|
Hello,
My office is using a schematron script that was created by an employee who does now work at our institution anymore. It was working fine until we upgraded to XMLSpy 2019. Then the scripts stopped working and we got error messages about not being able to retrieve the source (error message 1). When trying to validate the file that the schematron script is processing it does not validate as if the element declaration is not correct anymore (error message 2). Does anyone have any advices on how to fix it?
thanks,
Rachel
Error Message 1:
File S:\Metadata\Code\Schematron\Schematron_ETD.xsl: XSL transformation failed
Cannot retrieve resource 'S://Metadata/ETD/Staging/MODS/u0015_0000001_0003253.mods.xml'
Error location: xsl:stylesheet / xsl:template / xsl:for-each / xsl:apply-templates / <a href="https://www.codeproject.com/Members/select">@select</a>
Details
System Error 2: The system cannot find the file specified.
I/O Error 400: Don't know how to deal with relative URI (scheme name is missing).
I/O operation on file 'S:\\Metadata\ETD\Staging\MODS\u0015_0000001_0003253.mods.xml' failed.
FODC0002: Cannot use the URI supplied as the first argument to the 'doc' function, to retrieve a resource containing XML
Error message 2:
File S:\Metadata\ETD\Documentation\xmllists\20190605xmlList.xml is not valid.
File S:\Metadata\Code\Schematron\Schematron_ETD.xsl has errors.
Neither an element declaration nor a type definition is known for element <xsl:stylesheet>. Strict assessment failed.
Error location: xsl:stylesheet
Details
cvc-assess-elt.1: Neither an element declaration nor a type definition is known for element <xsl:stylesheet>. Strict assessment failed.
Neither an element declaration nor a type definition is known for element <xsl:import>. Strict assessment failed.
Error location: xsl:stylesheet / xsl:import
Details
cvc-assess-elt.1: Neither an element declaration nor a type definition is known for element <xsl:import>. Strict assessment failed.
Neither an element declaration nor a type definition is known for element <xsl:output>. Strict assessment failed.
Error location: xsl:stylesheet / xsl:output
Details
cvc-assess-elt.1: Neither an element declaration nor a type definition is known for element <xsl:output>. Strict assessment failed.
Neither an element declaration nor a type definition is known for element <xsl:template>. Strict assessment failed.
Error location: xsl:stylesheet / xsl:template
Details
cvc-assess-elt.1: Neither an element declaration nor a type definition is known for element <xsl:template>. Strict assessment failed.
Neither an element declaration nor a type definition is known for element <xsl:for-each>. Strict assessment failed.
Error location: xsl:stylesheet / xsl:template / xsl:for-each
Details
cvc-assess-elt.1: Neither an element declaration nor a type definition is known for element <xsl:for-each>. Strict assessment failed.
(and many pages more of this)
|
|
|
|
|
Member 14599986 wrote: Neither an element declaration nor a type definition is known for element <xsl:stylesheet>. Strict assessment failed.
That looks like the obvious place to start. Does your Schematron_ETD.xsl file have the correct xsl namespace declaration?
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ...>
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello!
I'm really desperate. I also googled and tried examples, which did not work in the end. I'm also a beginner in XML / Javascript and have very little XML knowledge. That's why I really ask for your help / explanation.
Following problem: I need an XML file that contains several images. In the HTML file, these images should then be read randomly from the XML file. Coincidentally in this sense, for example, that you specify 20 images in the XML file, but only 10 random images are displayed in the HTML file. I really do not know how to do that. I've also read websites, but I'm still not smart. I would be very happy about an example so that I understand it firstly and secondly apply it.
Besides, I do not know how to place these pictures in a particular place. It should be such that e.g. Image 1 is located at xy, while image 2 is to be displayed elsewhere on the site. How should I write the code so that it is output? Is that even possible?
I guess it will probably be easy, but I can not get on with it. I would be very happy to receive answers
|
|
|
|
|
XML is not an ideal vehicle for transmitting images, which would need to be encoded as some textual representation first. A better idea would be to use a database or just a directory with the images stored as files. As for displaying information via HTML/Javascript, you can find examples all over the internet. A good starting point would be W3Schools Online Web Tutorials[^]
|
|
|
|
|
Thank you for your answer! I have already implemented this with HTML and it works, but unfortunately it is required that the images can be read from an XML file. Something other than an XML file is not accepted. And that's my problem .. how could I solve this if nothing but an XML file is allowed?
|
|
|
|
|
|
Hi
I would like to query and display results from XML APIs (lINK) using Visual basic. I will have a search box with search parameters so the users can search the xml APi and get data displayed back on the browser or just the summary of the query indicating results so that users can click on the link and be redirected to the external site to view the details of their search,
similar to comparison sites... Could you please advise on the best solution and approach for this? any examples, tutorials or samples to try first, would be great
Thank in advance
|
|
|
|
|
hm9 wrote: the best solution and approach for this The obvious answer is: do some research, design, coding and testing. But it really is impossible to give a reasonable answer to such a wide question. Also we know nothing about your knowledge and skills. These forums are really for specific technical questions: How to get an answer to your question - XML / XSL Discussion Boards[^].
|
|
|
|
|
<xsl:if test="date">
<xsl:value-of select="date"/>
<xsl:text> • </xsl:text>
</xsl:if>
This is the code used in xsl file but the output showing Chinese month
|
|
|
|
|
There is no date conversion code in your question. All you're doing is copying the input value to the output, and appending some static text.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I am using a list of a class. Serialization works fine, but Deserialization leads to creating new lists, which are appended to main list. I.e. if Deflists in AllKeyList contains 5 KeyDefinition Classes, after Deserialization there are 10.
How can I force overriding?
Thx adv for your help.
What I'm doing:
FileStream fs = new FileStream(sFile, FileMode.Open);
var x = new System.Xml.Serialization.XmlSerializer(Setup.GetType());
var settings = new XmlReaderSettings { CheckCharacters = false, };
try
{
Setup = (DataSettings)x.Deserialize(fs);
Console.WriteLine("XML Read {0} erfolgreich", sFile);
Data structure:
public class KeyDefinition
{
public string Name { get; set; }
public string KeyType { get; set; }
public List<FieldToken> KeyDef { get; set; }
....
}
public class AllKeyList
{
public List<KeyDefinition> DefLists { get; set; }
...
}
modified 17-Jul-18 5:00am.
|
|
|
|
|
Hello all,
I just started learning HTML and I would like to save the value entered to a selected data list option.
<pre>
<!DOCTYPE html>
<html>
<head>
<title>Program using HTML </title>
<body bgcolor="LightGray" text="Black">
<form name="NUM">
<input list="document">
<datalist id="document">
<option value="wireset_623101">
<option value="wireset_623102">
<option value="wireset_623103">
<option value="wireset_623104">
<option value="wireset_623105">
<option value="wireset_623106">
<option value="wireset_623107">
<option value="wireset_623108">
<option value="wireset_623109">
<option value="wireset_623110">
<input value="button">
</datalist>
= <input name="number">
<br>
<input type="button" value=" 1 " onClick="document.NUM.number.value+='1'">
<input type="button" value=" 2 " onClick="document.NUM.number.value+='2'">
<input type="button" value=" 3 " onClick="document.NUM.number.value+='3'">
<button type="button" onclick="document.write(document.NUM.number.value +' wireset_623101')">NEXT></button>
<br>
<input type="button" value=" 4 " onClick="document.NUM.number.value+='4'">
<input type="button" value=" 5 " onClick="document.NUM.number.value+='5'">
<input type="button" value=" 6 " onClick="document.NUM.number.value+='6'">
<button type="button" onclick="document.write(document.NUM.number.value +'wireset_623110' )">ENTER</button>
<br>
<input type="button" value=" 7 " onClick="document.NUM.number.value+='7'">
<input type="button" value=" 8 " onClick="document.NUM.number.value+='8'">
<input type="button" value=" 9 " onClick="document.NUM.number.value+='9'">
<br>
<input type="button" value=" 0 " onClick="document.NUM.number.value+='0'">
</form>
<script>
</script>
</head>
</body>
</html>
|
|
|
|