|
OK,
Sorry for the shameless plug, but get the code for my article - Introduction to XPS[^] this includes code to use .Net Compiled Transform. Don't worry if you're a VBer I'm sure you can figure out the C#.
I just love Koalas - they go great with Bacon.
|
|
|
|
|
Hey Lee
ya i googled it from ur earlier reply and was able to find the VB code and i just tested it for transformation. It worked. wow, i have these so called senior developers on my side and it dint strike them when i asked them for this transformation tool. K thanks a million.
Regards
Teja
|
|
|
|
|
How do i convert an XML file to JSON(Java Script Object Notation) file using XSLT.
Help me......(new to XSLT).
Thanks in Advance
|
|
|
|
|
I'd recommend first learning some XSLT. You can do that at W3 Schools XSLT Tutorial[^].
Then, I'd recommend learning about JSON, if you don't know it already. You can do that at JSON.org[^].
Finally, map the elements from your XML file to serialized objects in the JSON file.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I'm writing a C# app to document the types of XmlSchemaComplex types...
I have a schema file containing complexTypes, and those complexTypes have elements which are of other complexTypes, located in another file that I'm including into my outer schema file. I'm reading the schema file, going into the complexTypes, and trying to read the types of the sub-elements that are of the sub-types.
However, the type attributes of the elements inside my main complexTypes are set to nulls, although the SchemaTypeText is filled out with the current type name and namespace.
The code that I'm using looks a little something like this (please pardon the horrendous noobishness):
XmlTextReader schemaReader = new XmlTextReader(schemaPath);
XmlSchema schema = XmlSchema.Read(schemaReader, null);
foreach (XmlSchemaObject xso in schema.Items)
{
if (xso is XmlSchemaComplexType)
{
XmlSchemaComplexType rootType = xso as XmlSchemaComplexType;
if (rootType.Particle is XmlSchemaSequence)
{
XmlSchemaSequence rootseq = (XmlSchemaSequence)rootType.Particle;
foreach(XmlSchemaObject ixso in rootseq.Items)
{
if (ixso is XmlSchemaElement)
{
XmlSchemaElement ele = ixso as XmlSchemaElement;
XmlSchemaType eleType = ele.SchemaType; // this is null
string typTxt = ele.SchemaTypeText; // this right, but strings.
}
}
}
}
If I can get the part about accessing the element types of the nested elements in my complexTypes right, I want to pass those complexTypes into a recursive method that'll enumerate all the members of the inner complexTypes for me, etc.
|
|
|
|
|
hello all
Can any one help me with the xml read and write operations using java
some sample codes......
which is used in java DOM ,SAX,,,,,
thanks
tJS
|
|
|
|
|
TJS4u wrote: Can any one help me
Sure, I always enjoy helping the google impaired.
Here you go[^]
Have a nice day.
|
|
|
|
|
Hi, I'm new to XSLT and i was hoping someone could point me in the right direction with the problem below...
I have the following XML:
<list level="1">
<item>1</item>
<list level="2">
<item>1</item>
<item>2</item>
<item>3</item>
</list>
<item>2</item>
</list>
I would like to extract the nested list and insert it between item 1 and 2 of the parent list:
<list level="1">
<item>1</item>
</list>
<list level="1">
<item>1</item>
<item>2</item>
<item>3</item>
</list>
<list level="1">
<item>2</item>
</list>
Any suggestions?
modified on Wednesday, February 25, 2009 11:14 AM
|
|
|
|
|
PeOpLesChAmP wrote: Any suggestions?
Check out www.w3schools.com. They have tutorials tailored for beginners as well as a complete reference.
|
|
|
|
|
How do i create an entry for an control in xml if the name contains "< >" characters. for Ex: name="[9] <mm>somename"
|
|
|
|
|
|
Hey all,
I have been writing a tool which will allow u to convert xml files into .docx files (Word 2007). For this one needs to have the xml and a related xsl file for it.
Now i also need to convert the word document to the basic xml file that was used earlier. I couldn'nt figure out a way to do that and so have converted that word document to a basic html file. Now i am in a fix as to how to convert that file in to the original xml file.
Is the technique which i am following(Word > html > xml) correct? Or is there a better way to do this?
If there is an easier or better way to do this, Please help me out.
Thanks in Advance
Teja
|
|
|
|
|
I guess the question is if your transformation from XML to DOCX represents a lossy or lossless transformation.
If the transformation causes loss in understanding the content or structure of the original XML file, then you cannot reconstitute the exact original XML file regardless of intermediary transformations, such as to XML.
Otherwise, if your transformation is lossless, then you should have enough information to write an XSLT document that provides the inverse of the original XSLT. In this case, your intermediary step of HTML is not needed.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hey Currtis,
Thanks for the reply. Mine is a loseless transformation.
I need a clarification. What do you mean by a reverse XSLT? Once i get my reverse XSLT, Do i need to use it on the Wordml document in order to transform it into a original xml?>
Please help,
Thanks in Advance
Teja
|
|
|
|
|
Hi, Teja.
You need to craft another XSLT document that is the inverse of your original XSLT document. You have XML -> WordML, now you need a WordML -> XML transformation, as well. Then, you just run the new XSLT on the WordML document to make it XML.
Do you want to do this because you don't retain the original XML? Or, you transform it from XML so that users can edit it in Word? Then, after their edits, you want to replace it in your document management/repository system?
You're welcome, in hindsight,
Curtis.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hey Curtis,
Wow, i dint know that there existed an inverse xslt that will help me convert the WordML to a the original xml. I guess now i need to figure out as to how to write the inverse XSLT. Yes the kind of interpretation u gave about wat am i trying to do is correct. I am trying to allow a user to open an xml as word document and when he edits it and saves it, i an trying to save it in the original xml format.
Could u send me any sites in which i could get a glance of the word to xml, xslt. if i get an example, i could start writing my own xslt for the document.
Thanks for the great help,
Thanks in advance,
Teja
|
|
|
|
|
Teja,
I regret that I have to write that I know of no Web sites or books that talk about how to create an inverse XSLT. However, since you have the original one, I would recommend going through the transformation command by command, figure out the mappings XML -> WordML, and then try to capture that in another XSLT.
I don't use it myself (because it costs money and I'm cheap : ), but Altova XmlSpy can help you with understanding the transformations with its XSLT editor and debugger. I think that Altova used to allow you to download a free edition, or you could ask your company to purchase a license for the Standard, Professional, or Enterprise edition. (Note: I do not work for or with Altova.)
Hope that helps and happy hacking!
You're welcome in hindsight,
Curtis.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Curtis,
Thanks a milliom for the reply. I guess this is a path that has less flowers and more thorns in it. So let me check out your suggestion and get back to you. I guess you need to know that i am not the best of pesons in writing xslts. All i hve done is taken an xslt of another xml document and have modified it in such a way that i can help show my xml in word. What you also have to understand is that, I am trying to generate an XSLT and convert my xml to word and back programatically in .NET. So i guess i will hae to figure out a way in which i can do this .
Thank you Loads
Teja
|
|
|
|
|
Hi,
I am trying to use an xslt to Transform an XML created by serializing a WCF DataContract object to HTML and i am not able to see the values in the out put.The xml is as folows
<Assessment xmlns="http://schemas.datacontract.org/2004/07/EDIM.DataContracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Respiration>
<Accessory>true</Accessory>
<AirWaySize>3.5</AirWaySize>
<AirwayCongestion>false</AirwayCongestion>
<Apneic>true</Apneic>
<AssessmentDateTime>2009-02-20T13:22:47.313</AssessmentDateTime>
<AssessmentIdentifier>1</AssessmentIdentifier>
<Assisted>true</Assisted>
<Asymmetrical>true</Asymmetrical>
<BSUpperAirwayL i:nil="true" />
<BSUpperAirwayR i:nil="true" />
<Barking>true</Barking>
</Respiration>
</Assessment>
I am new to xslt and i created a new xslt file from VStudio 2008 and gave this xml as input and i got the error "Unspecified error File:vsee\pkgs\vssprovider\sccprj.cpp Line number:3670" eventhought i did not change anything on the new file.Shouldn't it have given me something?
I used style vision of xmlspy and when i try to view the output the Values( for eg: assisted) does not show in output.
Am i missing anything? Please help....
|
|
|
|
|
Hi,
I am beginning using XML. I can write to XML ok but I am having problems reading it in C#. What have I done wrong and how can I fix it.
My code
XmlReader Reader = new XmlTextReader(Property.Settings.Default.XML_Location);
while (Reader.Read())
{
if (Reader.Name == "Finished"));
{
listbox1.Items.Add(Reader.Name + " : " + Reader.Value);
}
}
My XML page
<testapp>
<database location="C:\Program Files\Example" filename="test.mdb" full="C:\Program Files\Example\test.mdb" />
<finish finished="True" />
<testapp>
</testapp></testapp>
Thanks
|
|
|
|
|
I don't know what your current problem is because you did not state what it was. However using == in an object oriented system is not best practice. See string.Equals()
Secondly, "Finished" is NOT EQUAL to "finished".
jammmie999 wrote: if (Reader.Name == "Finished "));
jammmie999 wrote: <finish>finished ="True" />
|
|
|
|
|
Hey guys, how's it going?
Don't know if The CodeProject is the right place for this message, but what the hell
I put this on "General Discussions" earlier but got no reply, so I figured maybe the XML forum might help...
I have this closed network and I want to put a sh*t load of content from news sites and maybe even technical sites on it so that the people using it can view it as if they were online.
I was thinking of using RSS feeds for the job. Does anyone know where I can find a simple tutorial to show me how?
Thanks a bunch,
Lior
|
|
|
|
|
This[^] looks promising.
Otherwise, there's plenty of other sites here[^].
Kristian Sixhoej
"You can always become better." - Tiger Woods
|
|
|
|
|
Thanks Kristian!
But unfortunately, I wasn't gunning for this... I don't want to create a website on the internet with the rss feed on it. I want to get the metarial into a closed intranet server. I want to be able to put all of the feed onto a CD or something and get it OUTSIDE the internet.
Do you know of something with a simple interface allowing me to do so? Or how I can look it up on google? (Can't seem to phrase it properly)
Lior
|
|
|
|
|
I haven't heard of any interface or methods for this purpose, but you could build your own application that goes through a specified RSS feed, saving all the items in it to a text file.
That's the only way I can think of to accomplish this.
Kristian Sixhoej
"You can always become better." - Tiger Woods
|
|
|
|