|
Make sure you escape your '&' characters. I can't see your XSL output, but I'm guessing the problem is that you're using   , which is the equivalent of (a non-breaking space) in HTML. Try modifying the JavaScript to either parse   and as well as spaces or simply replace all occurrences of   and with a space.
xslOutput = xslOutput.replace(' ', ' ');
xslOutput = xslOutput.replace(' ', ' '); That should work... assuming I've guessed the problem correctly.
Michael Flanakin
Web Log
|
|
|
|
|
IXLMDOMDocument2Ptr pDoc;
// test.xml (UTF-8) encoded, :
//<?xml version='1.0'?><root>你好, hello</root>
// check in IE, no problem.
// resource type HTML, or BINARY tried.
// ... create pDoc, find resource, loadresouce,
// create IStream on HGlobal, everything seems ok
// and i checked the dubug info, show xml content correctly,
// and setting the IStream to the beginning of IStream
// but...
pDoc->async = VARIANT_FALSE;
pDoc->load(_variant_t(pStream)); // FAILs, it complains that no top level element in xml.
// but, when i write the stream into a disk file,
// and load form file, it's OK !!!
// if use loadXML((LPTSTR)hGlobal) the charactor shown is not correct.
|
|
|
|
|
It should not be much of a problem. I do it like this in a project (With all error handling removed. It just clutters up the example.)
int CHookApp::LoadXML (int rsrc, MSXML2::IXMLDOMDocument2Ptr& xml, CString& errMsg)
{
HRSRC hXSLResourceInfoBlock;
HGLOBAL hXSLResource;<br>
hXSLResourceInfoBlock = ::FindResource (m_hInstance, MAKEINTRESOURCE(rsrc), "XSL");<br>
if (hXSLResourceInfoBlock)
hXSLResource = LoadResource (m_hInstance, hXSLResourceInfoBlock);<br>
if (hXSLResourceInfoBlock == NULL || hXSLResource == NULL)
return -1;<br>
try {
_bstr_t xmlText ((char*)LockResource (hXSLResource));
if (xml->loadXML ( xmlText ) == VARIANT_FALSE)
return -1;<br>
}
catch (...) {
return -1;<br>
}<br>
return 0;
}
I wonder why my empty lines are removed from the <pre> block above. It remained in another reply of mine.......
-- modified at 5:03 Wednesday 14th December, 2005
|
|
|
|
|
Dear Experts,
I need some information on dynamic updation of XML file.
Our application asks the user to insert a file by giving the user browsing option.
We want our XML file (which contains the information about the residing files) to be dynamically updated as soon user specifies the path of the inserted file.
The next task is to dynamically update the XML file once the user select the file to be deleted by clicking on the Application UI.
We have to develop the code in C++.
Kindly send across your suggestion, opinion and helpful codes.
Regards,
Mayank Srivastava
Regards,
Mayank Srivastava
|
|
|
|
|
This may not belong in this section, but just a try.
How do you convert ByteArray into a Jpeg image?
|
|
|
|
|
byte[] buffer;
System.IO.MemoryStream ms = new System.IO.MemoryStream(buffer);
System.Drawing.Bitmap bm = new Bitmap(ms);
bm.Save("FilePath", System.Drawing.Imaging.ImageFormat.Jpeg);
|
|
|
|
|
Thanks a lot. I am really looking for code that can be implemented in the client [in Javascript].
Much obliged.
mysorian
|
|
|
|
|
Alguien tiene informacion sobre integracion de esquemas para base de datos,(teoria) y alguna aplicacion.
|
|
|
|
|
hi, i don't know how to add diferents rows to the same column, and i would like to know if somebody could tell me.:->
La Light
|
|
|
|
|
Iridania wrote: hi, i don't know how to add diferents rows to the same column, and i would like to know if somebody could tell me
You want to insert Row and Column in what thing ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi,
Help me anyone please... I want to create a tab control in asp.net application using xml.
baski
|
|
|
|
|
Hi Baskaran,
U can add new tabs and pages to the tabstrip controls by the follwing way.
Following is the way to add one tab to the tabstrip control but by using loop u can add as many tabs as u want to.
TabSeparator Ts = new TabSeparator();
tsVert.Items.Add(Ts);
Tab Tb = new Tab();
Tb.Text = "New Tab";
tsVert.Items.Add(Tb);
Ts = new TabSeparator();
Tx.DefaultStyle = Microsoft.Web.UI.WebControls.CssCollection.FromString("width:100%");
tsVert.Items.Add(Ts);
PageView pg = new PageView();
Label lbl = new Label();
lbl.Text = "Mahesh";
pg.Controls.Add(lbl);
mpVert.Controls.Add(pg);
Thank you.
-- modified at 1:36 Monday 5th December, 2005
|
|
|
|
|
hi ,
Things we have done:
Based on XML we have created one DTD for it.
Now in place holder we have placed details like skuid,full_name,product properties details.
Our requirement:
We have one full image path for every product in XML , we need to display product image for each product.
by the place holder text content dynamically increase according to xml file content .
but we are unable to locate picture dynamically.it shows only the first product picture.
constraints we found:
no dynamic increment of textbox like text
Advance Thanks,
|
|
|
|
|
I'm trying to add mouseOver effects to my xsl transformation.
<a><xsl:value-of select="EnglishName"/></a>
onMouse over
<a><xsl:value-of select="FrenchName"/></a>
any ideas how i can go about doing this ?
thank you
|
|
|
|
|
<a onmouseover="this.innerText = '{FrenchName}';" onmouseout="this.innerText='{EnglishName}';"><xsl:value-of select="EnglishName"/></a>
or
<A>
<xsl:attribute name="onmouseover">
<xsl:value-of select="FrenchName" />
</xsl:attribute>
<xsl:attribute name="onmouseout">
<xsl:value-of select="EnglishName" />
</xsl:attribute>
</A>
-- modified at 8:42 Tuesday 27th December, 2005
|
|
|
|
|
Is there an easy way to transform an xml document to another xml document with all the elements sorted?
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
-- modified at 23:38 Thursday 1st December, 2005
|
|
|
|
|
The xsl:sort element is used to define a sort key. This sort key determines the order in which selected nodes are processed by the xsl:for-each or xsl:apply-templates elements.
Syntax: <xsl:sort
case-order="upper-first" | "lower-first"
data-type="number" "qname" | "text"
lang="language-code"
order="ascending" | " descending"
select="expression"
>
</xsl:sort>
Sushant Mathur
Ocwen Financial Sol. Pvt. Ltd,
Bangalore,
INDIA.
|
|
|
|
|
I understand that I can use xsl to sort the individual elements if I wanted to create the xsl template by hand. I want to take an XML file, perform sorting on it, and export the sorted contents.
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
It could be much more easy if you go ahead with XSL sort .
|
|
|
|
|
Two questions
I have an xml file which does not contain end tags, Any idea how i can append end tags keeping the parent child relation intact. Sample tags listed below
<parent1>
<tag1></>
<tag2></>
<tag3>
<tag4></>
</>
</>
Anyone has an FPML import app?
|
|
|
|
|
I don't know any FPML import apps.
However, I can answer a question for you: If you have a file with tags that don't contain end tags, then you don't have an XML file.
If you have a half-baked, XML-like file with something like what you have listed in your post, <parent1><tag1></><tag2></>... , then you can do the following:
Initialize a stack
Open an input stream from your file
Open an output stream for the result
While you have not reached the end of the input stream
Read a character
Write the character to the output stream
If the character is "<"
Read the next character
If the character is a letter, then
Keep reading until you reach a ">", saving the characters
Push that string onto a stack
Write that string to the output stream
Else if the character is a "/"
Write a "/" to the output stream
Pop the top string from your stack and write it to the output stream
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I need to use XML with BORLAND C++. How to read data? How to insert data? Please, help me!!!
|
|
|
|
|
|
I need to read a XML file into C#, do som processing on the data and then write it out in a flat text file.
An example of the xml file can be found here[^]
I have played around with XmlTextReader but can't get my head around as to how i get the data into C# in a way so i can use it
|
|
|
|
|
XmlTextReader won't help you processing the Document. Try XmlDocument, or XmlDataDocument.
XmlDocument x = new XmlDocument();
x.Load(@"myfilepath");
then you can use XPath to find nodes, change them, etc.
Christian Graus - Microsoft MVP - C++
|
|
|
|