|
hi,
well I've made an XSL file and I linked it to the XML file with this code
<?xml version="1.0" encoding="utf-8"?>
<?xml:stylesheet type="text/xsl" href="e2.xsl"?>
When I open the xml file in IE the result is fine. but when I open it in FireFox 2.0.0.7 it give me this error:
XML Parsing Error: not well-formed
Location: file:///d:/xsl/e_changed.xml
Line Number 2, Column 6:<?xml:stylesheet type="text/xsl" href="e2.xsl"?>
-----^
Where am I going wrong??
Thanks in advance
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
You got your style sheet processing instruction wrong. It should be:
<?xml-stylesheet type="text/xsl" href="e2.xsl"?>
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
<pre><?xml version="1.0" encoding="utf-8"?>
<b><?xml:stylesheet type="text/xsl" href="e2.xsl"?>
</pre>
<?xml-stylesheet type="text/xsl" href="e2.xsl"?></b>
These two are the same... the above line is for declaring that the document is an XML document. You're not saying I should remove the above line r u?
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
This is wrong:
<?xml version="1.0" encoding="utf-8"?>
<?xml:stylesheet type="text/xsl" href="e2.xsl"?>
and this is right:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="e2.xsl"?>
Geo
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
ok so the : was wrong !!
Thanks George.
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
hi i m ajay
can any one of u tell me that for javascript problem where i should write my problem...
actually i want to make a fuction that can compare two dates....the date are in mm/dd/yyyy formate..
i want a alert that comes in that condition when second date will less thn first...
and i want this onclick of button
thxxx
Ajay Rathi
software engineer
NOIDA(UP),INDIA
|
|
|
|
|
Arihant rathi wrote: can any one of u tell me that for javascript problem where i should write my problem...
Certainly not in the XML/XSL or the SQL / ADO / ADO.NET forum. Personally, I would try the Web development forum.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
System.Exception: The XSLT path is invalid. It refers to an external resource, uses invalid syntax, or the XSLT was not found in the catalog
Exception: The XSLT path is invalid. It refers to an external resource, uses invalid syntax, or the XSLT was not found in the catalog.]
[Exception: Cannot load XSLT specified at ‘DataTransform1.xsl’.]
[Exception: An error occurred during rendering of the report.]
[Exception: An unexpected error occurred in Report Processing.]
Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension) +489
Microsoft.Reporting.WebForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension) +924
Microsoft.Reporting.WebForms.ServerReportControlSource.RenderReport(String format, String deviceInfo, NameValueCollection additionalParams, String& mimeType, String& fileExtension) +84
Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +153
Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +75
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
|
|
|
|
|
I am using the transform below to convert an ADO persisted XML to ExcelXML. The conversion is done correctly except the following minor issue.
The output from <xslt:template match="z:row"> block generates
this --> <Row ss:Height="15" xmlns="">
instead of --> <Row ss:Height="15">
Where is this xmlns="" coming from?
My Transform.
<?xml version="1.0" encoding="UTF-8"?>
<!--
This stylesheet is used to transform ADO recordset to Excel XML. By default, the
sheet converts the recordset to a complete Excel XML workbook
-->
<!-- xsl:param name="MakeHeader"/-->
<xslt:stylesheet xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
xmlns:rs="urn:schemas-microsoft-com:rowset"
xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:z="#RowsetSchema"
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns ="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
version="1.0"
exclude-result-prefixes="rs s dt z o x ss">
<xslt:output method="xml" omit-xml-declaration="no" indent="yes" encoding="UTF-8"/>
<xslt:template match="/">
<!-- Full -->
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns ="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="AltItem">
<Alignment ss:Vertical="Top" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
</Borders>
<Font ss:Color="#4A3C8C" ss:Size="10"/>
<Interior/>
</Style>
<Style ss:ID="Header">
<Alignment ss:Horizontal="Center" ss:Vertical="Top" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
</Borders>
<Font ss:Size="10" ss:Color="#F7F7F7" ss:Bold="1"/>
<Interior ss:Color="#4A3C8C" ss:Pattern="Solid"/>
</Style>
<Style ss:ID="Item">
<Alignment ss:Vertical="Top" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" ss:Color="#C0C0C0"/>
</Borders>
<Font ss:Color="#4A3C8C" ss:Size="10"/>
<Interior ss:Color="#CCCCFF" ss:Pattern="Solid"/>
</Style>
</Styles>
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>Exported from TopTraders Web Application</Author>
<Created>2003-04-22T13:43:53Z</Created>
<Version>1.0</Version>
</DocumentProperties>
<!-- Full -->
<!-- Output worksheet -->
<Worksheet ss:Name="Sheet">
<Table>
<!-- output the column name in the first row -->
<Row ss:Height="15">
<xslt:for-each select="/xml/s:Schema/s:ElementType[@name='row']/s:AttributeType">
<xslt:sort select="@name" />
<Cell ss:StyleID="Header">
<Data ss:Type="String">
<xslt:value-of select="@name" />
</Data>
</Cell>
</xslt:for-each>
</Row>
<!-- Output the record contents -->
<xslt:apply-templates select="/xml/rs:data/z:row">
<!-- <xslt:sort select="@CustomerID" /> -->
</xslt:apply-templates>
</Table>
</Worksheet>
<!-- Full -->
</Workbook>
</xslt:template>
<!-- Template to match individual record -->
<xslt:template match="z:row">
<Row ss:Height="15">
<xslt:variable name="current_row" select="." />
<xslt:for-each select="/xml/s:Schema/s:ElementType[@name='row']/s:AttributeType">
<xslt:sort select="@name" />
<xslt:variable name="attrName" select="@name" />
<Cell ss:StyleID="Item">
<Data ss:Type="String">
<xslt:choose>
<xslt:when test="s:datatype/@dt:type='dateTime'">
<xslt:value-of select="ms:format-date($current_row/@*[name()=$attrName],'MM/dd/yyyy')" />
</xslt:when>
<xslt:otherwise>
<xslt:value-of select="$current_row/@*[name()=$attrName]" />
</xslt:otherwise>
</xslt:choose>
</Data>
</Cell>
</xslt:for-each>
</Row>
</xslt:template>
</xslt:stylesheet>
|
|
|
|
|
In the style sheet the Row element is child of the stylesheet element (root) and a template element that both declare no default namespace. Since the Row element has no prefix specifying a namespace it is put into the empty namespace (xmlns=""). When put into the target XML file the mapping to the namespace persists. I guess you expected it to be copied to the target XML file and then belonging to the default namespace declared on the Workbook element.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks stefan for the comments, I was under the assumption that the subsequent template inherits the namespaces but I guess I was wrong.
Regards.
|
|
|
|
|
i'm trying to figure out how to build a transform to restructure a XML file into a format i can utilize... i was curious if anyone could give me an example of a transform that can get me started which can do the below...
Starting off with this:
<root>
<User>
<name>Tom</name>
</User>
<group name="office">
<group name="NY">
<user>
<name>Jane</name>
</user>
<user>
<name>Mike</name>
</user>
</group>
</group>
</root>
would like to restructure it to:
<root>
<User>
<group>\</group>
<name>Tom</name>
</User>
<user>
<group>\office\ny\</group
<name>Jane</name>
</user>
<user>
<group>\office\ny\</group>
<name>Mike</name>
</user>
</root>
|
|
|
|
|
I have to parse RSS channel definition XML file. I have appended one sample at the end of this topic.
I have installed MSXML parser 6 and uses it successfully. Please refer to function XmlRSSRead.
There are a lot of information about the channel and item of this channel. For example, one channel has title, link, description information. One channel may have a lot of item too. Each item also hase title, link, description information.
I have to extract title, link, description information in my application. I can not find one quick start guide from microsoft doucments.
Could anyone be kind to tell me what I should do next?
The following is the function I have now and the xml file I want to parse.
void XmlRSSRead( void )
{
//¡ä¡ä?¡§DOMDocument???¨®
MSXML2::IXMLDOMDocumentPtr pDoc;
HRESULT hr = pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument30));
if(!SUCCEEDED(hr))
{
AfxMessageBox( _T("?T¡¤¡§¡ä¡ä?¡§DOMDocument???¨®¡ê????¨¬2¨¦¨º?¡¤?¡ã2¡Á¡ã¨¢?MS XML Parser ??DD?a!") );
}
//?¨®?????t
pDoc->load( _T("D:\\temp\\mPhone\\Docs\\RSS\\nature.xml") );
//?¨²¨º¡Â?D2¨¦?¨°???achannel¦Ì??¨²¦Ì?,
// "//"¡À¨ª¨º??¨²¨¨?¨°a¨°?2?2¨¦?¨°
MSXML2::IXMLDOMElementPtr childNode ;
childNode = (MSXML2::IXMLDOMElementPtr)(pDoc->selectSingleNode("//channel"));
//¦Ì?¦Ì??¨²¦Ì?¨¤¨¤D¨ª
MSXML2::DOMNodeType nodeType;
childNode->get_nodeType(&nodeType);
//?¨²¦Ì???3?
BSTR var;
CString name;
childNode->get_nodeName(&var);
name = (char*)(_bstr_t)var;
//?¨²¦Ì??¦Ì
VARIANT varVal;
childNode->get_nodeTypedValue(&varVal);
CString strValue = (char*)(_bstr_t)varVal;
//?¨²¦Ì?¨º?D?,¡¤??¨²¨¢¡ä¡À¨ª?D
MSXML2::IXMLDOMNamedNodeMapPtr pAttrs = NULL;
MSXML2::IXMLDOMNodePtr pAttrItem;
childNode->get_attributes(&pAttrs);
long nCount ;
pAttrs->get_length(&nCount);
for(int i = 0 ; i < nCount ; i++)
{
pAttrs->get_item(i,&pAttrItem);
//?¨°???¨¦¨°?¨ª¡§1yo¡¥¨ºyget_nodeName,get_nodeTypedValue¦Ì?¦Ì?¨º?D???o¨ª¨º?D??¦Ì
//¨°2?¨¦¨°??¡À?¨®¦Ì?¦Ì?
CString strAttrName = (char*)(_bstr_t)pAttrItem->nodeName;
CString strAttrValue = (char*)(_bstr_t)pAttrItem->nodeTypedValue;
}
}
void mfXmlReadTest( void )
{
::CoInitialize(NULL);
MSXML2::IXMLDOMDocumentPtr spPtr;
HRESULT hr = spPtr.CreateInstance(__uuidof(MSXML2::DOMDocument30));
ASSERT(SUCCEEDED(hr));
spPtr->loadXML("<r>\n<t>top\nbottom\n");
spPtr->save("C:\\nature.xml");
spPtr.Release();
::CoUninitialize();
}
XMLÎļþÈçÏ£º
<rss xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd" version="2.0">
<channel>
<title>Nature Podcast
http://www.nature.com/nature/podcast/rss/nature.xml <description>Nature is a weekly international journal publishing the finest peer-reviewed research in all fields of science. The Nature Podcast is a free weekly audio show highlighting content from each issue, and interviews with the scientists creating the data. The Nature Podcast provides insight and context to groundbreaking research, and allows the scientists to explain the significance of their work in their own words.
<language>en
<copyright>© 2006 Nature Publishing Group
<lastbuilddate>Wed, 25 Jul 2007 18:00:00 GMT
<category>Science & Medicine
<category>Technology
<url>http://www.nature.com/nature/podcast/images/nature_rss_logo.png
<title>Nature
http://www.nature.com/nature/podcast/rss/nature.xml <width>144
<height>144
<itunes:author>Nature
<itunes:subtitle>Interviews, insight and highlights of the latest scientific discoveries, every week in Nature
<itunes:summary>Nature is a weekly international journal publishing the finest peer-reviewed research in all fields of science. The Nature Podcast is a free weekly audio show highlighting content from each issue, and interviews with the scientists creating the data. The Nature Podcast provides insight and context to groundbreaking research, and allows the scientists to explain the significance of their work in their own words.
<itunes:owner>
<itunes:name>Nature
<itunes:email>podcast@nature.com
<itunes:category text="Science & Medicine">
<itunes:category text="Technology">
<itunes:image href="http://www.nature.com/nature/podcast/images/nature_itunes_logo.png">
<item>
<title>Nature Podcast: 26 July 2007
http://www.nature.com/nature/podcast/v448/n7152/nature-2007-07-26.mp3 <description>?26 July: Rain changes of our own making, science in the Simpsons, Californian-style plate rifts, investigating inflammatory bowel disease, pygmies with palm pilots.
<guid>http://www.nature.com/nature/podcast/v448/n7152/nature-2007-07-26.mp3
<enclosure url="http://www.nature.com/nature/podcast/v448/n7152/nature-2007-07-26.mp3" length="13343922" type="audio/mpeg">
<pubdate>Wed, 25 Jul 2007 18:00:00 GMT
<category>Science & Medicine
<category>Technology
<itunes:author>Nature
<itunes:subtitle>?26 July: Rain changes of our own making, science in the Simpsons, Californian-style plate rifts, investigating inflammatory bowel disease, pygmies with palm pilots.
<itunes:duration>37:03
<itunes:explicit>no
<itunes:category text="Science & Medicine">
<itunes:category text="Technology">
<itunes:keywords>nature, podcast, science, technology, education, science news, biology, physics, genetics, astronomy, astrophysics, quantum physics, evolution, evolutionary biology, geophysics, climate change, earth science, materials science, science policy, medicine, systems biology, genomics, palaeobiology, ecology, molecular biology, cancer, immunology, pharmacology, developmental biology, biochemistry, bioinformatics, nanotechnology, biotechnology, drug discovery, environmental science, life, marine biology, medical research, neuroscience, rna, dna, cell cycle, signal transduction, cell signalling
|
|
|
|
|
I have two XSD File. one is master and second is its child. i m creating the dataset from child XSD. now i m setting the data into dataset and then generating xml file from this dataset. it is working fine. But the problem is that the sequence defined in master file is not following in the xml file created thru DATASet.
can any body help me.
kishore
|
|
|
|
|
Never tried that but wouldn't you need to generate your DataSet from the Master file?
|
|
|
|
|
I've a problem for which I can't seem to find an elegant/efficient solution. Maybe someone would have an answer/hint. Did RTFM, googled, read 2 Java/Sax books.....
We have a servlet which is accepting a SOAP request. This is fed to a SAX2 XMLFilter (called SoapXMLFilter) and the result of this using an XMLWriter is put as the string 'payload' in a Result object. Later a new SOAP request is generated, part of the body of this SOAP msg is the payload string. This is given to a MessageQueue. So far so good.
In the new setup the header of the SOAP message contains a <security> block. The body contains amongst other things a <logistic> block. In the past SoapXMlfilter returned only the logistic> block (using super.startelement super.endelement etc.... In the new situation I have to return the following <logistic> <security> . Eg the security block is now INSIDE the logistic block.
When at the endelement tag for logistic I would like to insert the security block. Using a XMLWriter inside SoapXMLfilter I can put the security block into a string. At the endelement for Logistic I have this available. I somehow must have this block returned from SoapXMLFilter.
Things I can come up with:
---------------------------
1) Put security block as string security in a Object Body (using XMLwriter inside SOAPXMLWriter, this already works) . Put things between the <logistic> and tags as string logistic (using another XMLWriterr) in Object body. When generating end SOAP request. Create Stringbuffer, append "<logistic>", append logistic string, append security string, append "". Hence I know have a security block inside the logistic block. I find this UGLY and this should be done in SOAPXMLFilter.
2) The super.startelement(, , ,) super.endelement(, , ) are put in a String array. At endelement of Logistic I somehow have to execute them. Don't know if this is even possible......
3) Maybe an an additional XMLFilter inside SOAPXMLfilter which has as input has the security string. Maybe you can pass as a parameter the original XMLreader handler so that somehow a <orginal xmlreader="">.startelement inside this additional XNLFilter will have the effect of a super.startelement in SOAPXMLfilter. Eg SOAPXMLfilter returns the security block inside the logistic block. No idea if this possible at all..........
4) Easy, elegant, fast. I've missed it....... At this point I'm basically given up.
SoapXMLfilter is in fact a very complex beast which does many many things. Rewriting this is not an option (if it works don't...) . The website is a higtraffic one which means a solution has to be efficient (speed and memory footprint wise). This all means I need a solution using SAX2 (DOM or something like is not really an option I think).
Any hints/pointers are HIGHLY appreciated.
|
|
|
|
|
I ve got an error: I cannot use 'Content' element. The expected one is: 'Content'. erghh...
The element 'HelpText' in namespace 'http://korepetytor/HelpXmlSchema' has invalid child element 'Content' in namespace 'http://korepetytor/HelpXmlSchema'. List of possible elements expected: 'Content' in namespace 'http://korepetytor/KorXmlSchema'.
The HelpXmlSchema has an import element, which links to KorXmlSchema, which has a complex type 'Text'. 'HelpText.Content' is of type 'Text', but it is correctly imported and validation of HelpXmlSchema is positive.
How can I get around this? I use VS 2005. Please help.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
It would help to see the files in question or at least the important parts.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks for answer, although I have succeed to solve it myself.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Hello,
VS 2005
I am creating a PDA application that will get data from a database and display the data to the user.
When the user has finished using the application, I want to save the changes from the dataset to an xml file using the datasets read and write xml methods.
However, as the xml files are left on the PDA, any one could open them and view the contents of the data that has been saved.
Which is the best method to quickly encrypt the xml and decrypt it?
Many thanks,
Steve
|
|
|
|
|
There are encryption classes in .NET and also support in the Xml namespace for encrypting/signing XML. There isn't necessarily a "best method", it all depends on what you want and how you want it to work.
|
|
|
|
|
Is there a way to serialize non-textual objects, for example fonts and colors, using XML Serialization. working fine with binary formatter, but I have to use XML for political reasons.
Thanks PhilD
|
|
|
|
|
pjd1001 wrote: I have to use XML
XML is text based so the question is can you represent your data in text. The answer of course is Yes. There different ways to do it. Lets look at a Date. It's a numeric type so we can store the string representation of the number or we can transform the date into a human readable format and store that as long as we can parse it back into the numeric type it will work. Another approach is to use a standard binary data mechanism in XML which is Base64 encoding.
Does that help?
|
|
|
|
|
Yeah, but I dont have to do the transforms on a double or or an int, nor a decimal (I think) so why should I have to do common things like Colors & Fonts - I guess I resent having to delve into XML serilization when binary works fine.
|
|
|
|
|
What are we, girl friends? I don't think so.
Besides, if you don't like writing code just switch to being a Visual Basic Drag n Drop developer.
|
|
|
|
|