|
Javascript running in IE is not allowed to access the file system of the local machine.
Why are you trying to save the document, is there another way you can get the same result?
Regards
Mark Smithson
|
|
|
|
|
I was writing an editor, using the XSLT bound to an XML document to generate a HTML form, which used Javascript to tie into a XML DOM. I wanted to be able to save, and I found a way using a FileSystemObject activex control, but I was just wondering why I couldnt save using the Javascript. Thanks
Jesse Rosalia
|
|
|
|
|
Hi CPians,
I need to convert Word docs and Excel to XML. The problem is that I need to do this in my ASP.NET application. I am not looking for an application that does this. I need information on how I can implement it myself.
I have been looking around but haven't found anything usefull.
Anyone has any idea?
any links ?
Thanx!
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
two solutions
1) get word to save the doc as html and convert that
2) use automation to generate an xml documnet directly.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
I new about saving as HTML etc... and this is not good for me, but automation seems to be what I need.
It looks as if I have to spend some time on reading about automation, haven't used it before.
But I guess this is what soft. dev. is all about!!;P;P;P
Thanx!
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
In case you didn't know, html is a different thing than xml. Office Xp provides both xml and html support, for import and export. And these are different namespaces and file formats.
For instance, Excel XP outputs a spreadsheet to either .xml using the internal XML-SS file format, or the VML+MSO based .html web archive.
|
|
|
|
|
i guess thats why they are spelt different
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Hopefully someone can help me...I'm creating this game...it's kind of like a create a story thing...and when the user clicks on a button it moves on to the next skit. Well, instead of moving onto the next skit, it's will keep playing the first skit. Does anyone know what actions have to be assigned?
email: candykid89@hotmail.com
AIM: BinaryBiotch
|
|
|
|
|
wrong section.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Hi,
Can i split a huge class in C# to multiple files
Thank you
Regards,
Ajith
|
|
|
|
|
Hi
I am having problems outputing XML data in IE5.0. The XML data is written to a Session variable and has an XSLT stylesheet linked to it and I then use Response.Write to output the final sheet of data.
The problem is that the data within the XML file is not showing but the layout specifcied in the XSLT file is showing fine, so its liek an empty form.
In IE6 the sheet of data shows up perfectly.
I was wondering if the IE5's XML parser was rather different to the one in IE6 which causes this problem or if it was some other problem.
Amy help at all on shedding light on this would be really great
Cheers
John
|
|
|
|
|
IE5.5 and IE6 have different XSLT engines.
|
|
|
|
|
In the XSL file, the following syntax is used:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
However, in the XML file, the following syntax is used:
<?xml-stylesheet type="text/xsl" href="C:\test\MyStyleSheet.xsl"?>
In the XSL file, it’s a colon after ‘xml’, in the XML file, it’s a dash. Why is this? (xsl:stylesheet versus xml-stylesheet)
Internet Explorer can handle a colon or a dash in the XML, and transforms the XML correctly into the browser window but .NET only accepts a dash when parsing XML in code. Also, .NET only accepts the http://www.w3.org/1999/XSL/Transform namespace, and not the older http://www.w3.org/TR/WD-xsl namespace.
Am I right with these assumptions?
Thanks,
John.
|
|
|
|
|
Two different things, one is a processing instruction with target "xml-stylesheet", the other is a start tag with name "stylesheet" which is in namespace "xsl".
|
|
|
|
|
Thanks
|
|
|
|
|
(Also crossposted to ASP.NET)
I have an XML file which has the XSL file specified in the first line:
<?xml:stylesheet type="text/xsl" href="C:\test\MyXSLFile.xsl"?>
<Root xmlns:HTML="http://www.w3.org/Profiles/XHTML-transitional">
<Parameters>
<AgreementID>1380852</AgreementID>
…. And the rest of the XML data follows ….
I need to transform and output this as HTML. How can this be achieved in ASP.NET / VB.NET ? I have tried using the xmlTransform class, but it doesn’t seem to like the XSL reference embedded in the XML file. E.g:
Dim myXslTransform As XslTransform
Dim myXPathDocument As XPathDocument
myXPathDocument = New XPathDocument("C:\test\test99.xml")
myXslTransform = New XslTransform()
' myXslTransform.Load("") 'I don't have a separate .XSL stylesheet...
Dim stWrite As System.IO.StringWriter = New System.IO.StringWriter()
myXslTransform.Transform(myXPathDocument, Nothing, stWrite)
Response.Write(stWrite.ToString)
Gives the following error:
'xml:stylesheet' is an invalid name for a processing instruction. Line 1, position 3.
Changing the first line of the XML file to read <?xml-stylesheet ... > (dash instead of colon) gets rid of this error, but then I no longer have the XSL link, and it just outputs ‘raw’ XML!
My end goal is to be able to read in multiple XML files in this format and output them to ONE browser page as HTML. Without having to load the XSL seperately. I mean, the XSL already ref'd in the XML, so I should surely be able to send it to the browser directly as HTML
Any help is much appreciated.
John.
|
|
|
|
|
John Honan wrote:
'I don't have a separate .XSL stylesheet...
And yet you're referencing "C:\test\MyXSLFile.xsl"? Isn't that your seperate stylesheet?
If its a straightforward transform, you could try the XML control.
|
|
|
|
|
MS le Roux wrote:
And yet you're referencing "C:\test\MyXSLFile.xsl"? Isn't that your seperate stylesheet?
I should have been clearer on that. The separate stylesheet does exist, but I don't see why I have to go to the trouble of loading it if it's already referenced in the XML. IE can pick it up directly from the link in the XML, so why not .NET?
However, from my research and some replies I've received, I don't think the XML classes in .NET can pick up an 'embedded' stylesheet like this, so I'll have to just load it separately anyway.
Just trying the lazy approach!
John.
www.silveronion.com[^]
|
|
|
|
|
I have a problem with a string containing the £ symbol (GB pounds). I can set the text of a child node using m_pXMLDoc->createTextNode(pszText) to a string containing £ chars ok, but if I try to reparse the xml using MSXML e.g. try displaying it in IE it complains about an invalid character i.e. the £. No problem I thought, I'll replace all £ chars with their escape sequence i.e. _163; (please ignore the _ - I had to include it to prevent HTML replacing the escape sequence with a £). All appears to work ok e.g. I can reparse the XML with MSXML and display it in IE, but MSXML has escaped my escape sequence i.e. instead of _163; the string contains £.
How can I stop MSXML doing this to my escape sequence? Or, how can I include a £ char in a string. I have to use MSXML 3, I can't use a DTD/Schema (don't ask) and I can't use a CDATA section (again, don't ask). Any help/advice would be much appreciated.
Gavin
|
|
|
|
|
this is a classic problem - you will run into it all the time.
the important point is that £ is resolved by the parser, i.e. by the time you get a look in it has been converted to its character.
generally these issues are caused by the encoding attribute that is specified at the top of your xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
People have a nasty habit of sticking any old encoding in here, without considering what encoding they are using - for example different versions of windows (95, 98, NT) have used different encoding schemes.
Also be careful if you use XSLT - you have to tell it how to output it
<xsl:output encoding="iso-8859-1"/> .
Otherwise you will end up in a world of pain
my general advice is to always replace any characters with values below 32 and above 128 with a tag - this allows you to handle the problem. consider using a <character code="163"/> tag, this way you can do what you like.
hope this helps.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Hi,
I have a problem with streaming XML. I have created an aspx which return me an xml file format (Type text/xml, Encoding.UTF8). Also now, I try to read this stream in the XmlTextReader but I receive an Error Message when I parse it. And of course, I don't understand that.
Could you help me?
It is a bit urgent....
Thanks a lot
Code Source
XmlTextReader XR = new XmlTextReader(Server.MapPath("GenerateXmlTreeView.aspx"));
while(!XR.EOF){
XR.ReadElementString(); //Here Thrown exception
}
Sr.Close();
When I run may aspx
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Xml.XmlException: The '%' character, hexadecimal value 0x25, cannot begin a name. Line 1, position 2.
Source Error:
Source XML:
<?xml version="1.0" encoding="utf-8"?>
<treeview title="Licenses Tool">
<custom-parameters>
<param name="shift-width" value="15" />
<param name="img-directory" value="images/" />
</custom-parameters>
<folder title="1999" url="49">
<folder title="Gis Eastern" url="39">
<leaf title="Azerbaijan" url="37" reg="N" />
<leaf title="Belarus" url="20" reg="N" />
<leaf title="Bulgaria" url="21" reg="N" />
<leaf title="Croatia" url="22" reg="N" />
<leaf title="Czech Republic" url="23" reg="N" />
<leaf title="Estonia" url="24" reg="N" />
<leaf title="Hungary" url="25" reg="N" />
<leaf title="Kazakhstan" url="26" reg="N" />
<leaf title="Latvia/Lettonia" url="27" reg="N" />
<leaf title="Lithuania" url="28" reg="N" />
<leaf title="Poland" url="29" reg="N" />
<leaf title="Rumania" url="30" reg="N" />
<leaf title="Russia" url="31" reg="N" />
<leaf title="Slovakia" url="32" reg="N" />
<leaf title="Slovenia" url="33" reg="N" />
<leaf title="Turkey 1" url="38" reg="N" />
<leaf tit
-=zoltx=-
|
|
|
|
|
this wont work because you are reading the source for the apsx, i.e. you are getting back the <% aspx stuff %>
you need to load the xml from using a uri, not from the file system
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Hi all,
I have the following sample XML file
<ROOT>
<STRING id="Some string \"some with in quotes\" other\'s with apostrophee %s">
<LOCALE>Locale Equivalent of above id string</LOCALE>
<FILE line="321">myheader.h</FILE>
</STRING>
<!-- Many string tags to follow-->
<?ROOT>
The "id" contaims string constants extrcted out of C/C++ source code. and the value contains "LOCALE" contains locale equivalent string.
I load the xml document document using the XmDocument.Load( fileName) in C#.
Sample code
string idvalue = "Some string \"some with in quotes\" other\'s with apostrophee %s";
string path = "/ROOT?STRING[@id = \"" + idvalue + "\"]/LOCALE"; // so as to get the text between LOCALE tag
XmlDocument doc = new XmlDocument();
doc.Load(fileName);
string str = doc.DocumentElement.SelectSingleNode(path).InnerXml;
Howvever the the statement throws an exception because the quotes in the path string is not escaped in XML. SelectSingleNode() takes an XPATH expression. How to escape the quotes in an XPATH expression so that the last statement works correctly.
The last expression is a problem only when their is a " in id attribute, since the attribute value is enclosed in quotes in Xpath. for id attribute values with no quotes takes me correctly to the text betwen LOCALE tag
I tried encoding the " in variable idvalue to " in XPATH, still no success
The XML is successfully validated internally aginst a DTD.
The XML file contains ", ', &, <, > in their encoded form.
Any solutions to offer
Regards,
Ajith
Regards,
Ajith
|
|
|
|
|
Its seems the XML contents I posted previously has not come.
Here I am posting it as a comment
<br />
--<ROOT><STRING id="\"Hello\'s World\""><LOCALE>Locale specific text equivalent value of id</LOCALE></STRING></ROOT><br />
--
Regards,
Ajith
|
|
|
|
|
Just go back and edit your message. Make sure to check the display message as-is (no HTML).
<MyXML> Here is text </MyXML>
<b><i>"Sig"</i></b>
|
|
|
|