xml

Dependent naming of XML element in Xml Schema

半腔热情 提交于 2021-02-11 08:10:24
问题 Assuming that I have this XML: <parameters> <parameter type="string" isVisible="True" optional="False" id="DealerCode"> <DealerCode>ABCDEF001</DealerCode> </parameter> </parameters> I used a Xml-Schema generator to generate me a basic one. This results in this: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified"> <xs:element name="DealerCode" type="xs:string"/> <xs:element name="parameter"> <xs

Dependent naming of XML element in Xml Schema

喜欢而已 提交于 2021-02-11 08:08:49
问题 Assuming that I have this XML: <parameters> <parameter type="string" isVisible="True" optional="False" id="DealerCode"> <DealerCode>ABCDEF001</DealerCode> </parameter> </parameters> I used a Xml-Schema generator to generate me a basic one. This results in this: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified"> <xs:element name="DealerCode" type="xs:string"/> <xs:element name="parameter"> <xs

Can two elements have different names but same type in XSD?

泪湿孤枕 提交于 2021-02-11 07:13:46
问题 Consider the two scenarios: I have one XML that looks like: <personinfo> <info> <option1>Coke</option1> </info> </personinfo> where I should have a choice between an option1 and option2 element. I have another XML that looks like: <personinfo> <info> <firstname>Yair</firstname> <lastname>Zaslavsky</lastname> </info> </personinfo> where both firstname and lastname should appear (hence a sequence). I have tried to use the following schema: <?xml version="1.0" encoding="UTF-8" ?> <xs:schema

Mulesoft 3 DataWeave - split a string by an arbitrary length

懵懂的女人 提交于 2021-02-11 07:09:04
问题 In Mule 3 DataWeave, how do I split a long string into multiple lines by a set length? For instance, I have the following JSON input: { "id" : "123", "text" : "There is no strife, no prejudice, no national conflict in outer space as yet. Its hazards are hostile to us all. Its conquest deserves the best of all mankind, and its opportunity for peaceful cooperation many never come again." } The input system can only accept strings of 40 characters or less, so the output XML needs to conform as

Mulesoft 3 DataWeave - split a string by an arbitrary length

删除回忆录丶 提交于 2021-02-11 07:08:50
问题 In Mule 3 DataWeave, how do I split a long string into multiple lines by a set length? For instance, I have the following JSON input: { "id" : "123", "text" : "There is no strife, no prejudice, no national conflict in outer space as yet. Its hazards are hostile to us all. Its conquest deserves the best of all mankind, and its opportunity for peaceful cooperation many never come again." } The input system can only accept strings of 40 characters or less, so the output XML needs to conform as

Mulesoft 3 DataWeave - split a string by an arbitrary length

十年热恋 提交于 2021-02-11 07:08:10
问题 In Mule 3 DataWeave, how do I split a long string into multiple lines by a set length? For instance, I have the following JSON input: { "id" : "123", "text" : "There is no strife, no prejudice, no national conflict in outer space as yet. Its hazards are hostile to us all. Its conquest deserves the best of all mankind, and its opportunity for peaceful cooperation many never come again." } The input system can only accept strings of 40 characters or less, so the output XML needs to conform as

How to pick value of multiple nodes and test it in a single condition?

给你一囗甜甜゛ 提交于 2021-02-11 06:51:31
问题 In continuation to this post, I have restructured the code to better understand my requirement. I have also provided more detail to it. XML FILE <Person> <Name>Kavya</Name> <Gift> <ItemName>PD1</ItemName> </Gift> <Gift> <ItemName>PS1</ItemName> </Gift> <Gift> <ItemName>PD2</ItemName> </Gift> </Person> Now, In the above structure, I need to return a text Successfull only when the Person has a Gift with ItemName that is empty or has only PS1 and not PD1 or PD2 . So, when writing an XSLT file, I

Dynamic root element with Jackson

淺唱寂寞╮ 提交于 2021-02-11 06:44:13
问题 I'm currently working on a project that deals with elements that (for legacy reasons) must have a tag name that represents their type. Basically I have this: @JsonRootName("node") class NodeDocument { private String type; } Which outputs something like: <node type="someType"></node> But what's expected would be: <someType></someType> @JsonRootName doesn't seem to be usable on a method or attribute. Even though there is SerializationConfig.withRooName() or custom serializers, I can't seem to

Dynamic root element with Jackson

不羁岁月 提交于 2021-02-11 06:43:10
问题 I'm currently working on a project that deals with elements that (for legacy reasons) must have a tag name that represents their type. Basically I have this: @JsonRootName("node") class NodeDocument { private String type; } Which outputs something like: <node type="someType"></node> But what's expected would be: <someType></someType> @JsonRootName doesn't seem to be usable on a method or attribute. Even though there is SerializationConfig.withRooName() or custom serializers, I can't seem to

Serialize list of strings as an attribute

試著忘記壹切 提交于 2021-02-11 06:31:25
问题 I am working with XML serialization, I am doing good so far. However, I stumbled with a problem and I wish if you guys can help me with it. I have a class as following: public class FrameSection { [XmlAttribute] public string Name { get; set; } [XmlAttribute] public string[] StartSection { get; set; } } When serialized, I got something like that: <FrameSection Name="VAR1" StartSection="First circle Second circle"/> The problem is with deserialization, I got four items rather than two as space