|
Most likely, Andy, you'll have to do the following in the programming language of your choice:- Create the content for the login POST request.
- Stream the post request to the server over the applicable port.
- Read the response.
- Parse out the Set-Cookie lines from the HTTP response.
Here's the HTTP RFC[^] for reference.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thanks for your reply.
is there any psudo code which i can follow in xsl or xml ?
Cheers
Andyy
|
|
|
|
|
This really isn't an XML or XSL problem.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hey everyone
When i save a word document as an XML file it write a large amount of data into the xml document. I have used an XSL file to only capture the required data from the wordML to my own xml file. This customized xml file should have only the tags specified in the xslt. Look into the file below
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
- <pkg:part pkg:name="/_rels/.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="512">
- <pkg:xmlData>
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" />
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" />
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml" />
</Relationships>
</pkg:xmlData>
</pkg:part>
- <pkg:part pkg:name="/word/_rels/document.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="256">
- <pkg:xmlData>
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" Target="webSettings.xml" />
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml" />
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />
<Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml" />
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="fontTable.xml" />
</Relationships>
</pkg:xmlData>
</pkg:part>
- <pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml">
- <pkg:xmlData>
- <w:document xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns ="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
- <w:body>
.................................. so on and so forth
From this file i am only trying to extract the data that written in the document. It goes this way
Name Teja
Age 22
For this i have written a small xsl file which looks this way
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
exclude-result-prefixes="w"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="w:p">
<Details> <xsl:value-of select="."/> </Details>
</xsl:template>
</xsl:stylesheet>
Now i am expecting my result to be an xml document with my own xml tags. This is how i want my document to look like
Name
Teja
Age
22
Now to look at the result i have been using xml notepad. But to convert WordML to XML i need a convertor. What do i need to use in order to do that?
Please help me out
Thanks in Advance
Teja
|
|
|
|
|
Tejabhiram wrote: But to convert WordML to XML i need a convertor
Do you mean something to read the WordML as XML to feed it to your XSLT, or do you mean something to actually run your XSLT?
For the former, use something like 7-zip to extract the source files from inside the docx - I'm guessing that you're already doing this though.
For the latter you can use the msxml commandline tool, or if you want to code it I'd use the .Net XSL compiled transform in your code. Or Saxon if you need something in the Java domain
I just love Koalas - they go great with Bacon.
|
|
|
|
|
Hey Lee,
Ok let me explain it to u i detail. I need to write a .NET application which can help me open a normal xml file in word. Then when the user modifies the content, i need to store the modified content back to the original xml file. In order to do this, first i am writing a xslt to convert my xml file to word file. Then when the modification is done,I am saving the Word Document as WordML, writing another inverse xsl file to convert WordMl to the original xml format. In the XML to word process, the word itself is taking care of the conversion process. But in the reverse process, I am not able to figure out how to convert the file back to a normal xml file.
From you questions I analyuze that i am trying to do the latter part, i.e run my xsl. Now to do that, you have suggested me to use the .NET XSL compiled transform i my code. How do i do that? Where can I find information regarding this?
Please help me out
Thanks in Advance
Teja
"Why to be a MAN when you can be a SUCCESS?"
|
|
|
|
|
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....
|
|
|
|