|
I am using Windows XP, Microsoft Visual Studio 2003 .NET, with MFC. I am working on an application that compresses itself into an XML file or can be saved in the XML format. When it is compressed, it shows additional information I added into the tooltip, which shows when the operator puts the mouse over the file. I am trying to add information to the file's tooltip when it is saved as an XML document as well. However, the tooltip only displays the document's type, date, and size. Do you know how to make an XML file ("filename.xml") show additional information in the tooltip when the operator puts the mouse over the filename?
AeJai
|
|
|
|
|
XML is basically a data container. You usually have to transform it to something else in order to get a more advanced interface. You can transform it to HTML and use CSS and/or Javascript to get the desired effect.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi every one,
I've generated this xsl code from my C# application and I've given the error statement in bold here. the problem is that I wanna filter the contents of an XML file and generate its HTML. So far its working fine as long as I select one Author(as the filtering is based on the name of the author). but whenever select two or more it gives an error on XSLT. Its actually the XsltCompileException and it points out this line given in bold... So can any one plz help me in this regard and tell how exactly this kind of expression should be formatted. Any help would be highly appreciated... Thanks
xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
xsl:output method="html" indent="yes"/><xsl:template match="/">
<title>Trying to filter
xsl:for-each select="bookstore/book">
xsl:choose>
xsl:when test="author/first-name='Herman' | author/first-name='Imaginary' ">
/xsl:when>
/xsl:choose>
/xsl:for-each> /table>
/xsl:template>
/xsl:style sheet
// I've made a few syntactic mistakes here intentionally (removed '<' character)coz this is not showing the contents of Xml when i posted this... its only showing Html... Hello... maderators of this forum... whats happening here?? (no offense)
RockyTitle | Price | xsl:value-of select="title"/> | xsl:value-of select="price"/> |
|
|
|
|
|
xsl:when test="author/first-name='Herman' | author/first-name='Imaginary' ">
oh well i got it sorted out myself... just changed it to
xsl:when test="author/first-name='Herman' or author/first-name='Imaginary' ">
and it worked!
Thanks anyway
|
|
|
|
|
am search for certain record in a grid, based on a Column "Lis_key", Field Lis_key in my table constist of strings that are 6 pairs like (XXXXXXXXXXXX),a user will enter 4 Digits, and it should bring all the record that have 4 starting with the input entered by the user through a textbox. i have entered the Following code in my Search Button.
PLease Note that my table has relations and both have "Lis_key" Field, the second table"Property_Summary" ,i dont want to do any Edits, only view, but on the Property_Mass, i want to do updates on only one Column.
PLease help me on this regard. here is my code in the button.
'Open Database Connection
Dim strconnection As String = "workstation id=5875-049;packet size=4096;user id=$$$$$$; Password=######;data source=##########;persist security info=False;initial catalog=Tshwane_Valuations"
Dim cn As SqlConnection = New SqlConnection(strconnection)
cn.Open()
'set up data adapter
Dim strSql As String = _
"select Actual_Extent,Attrib_code,Lis_key,Func_key,Density," _
& "New_Net_Usable_Extent,New_Total_Land_Factor,New_AdJ_Extent_1,New_Points_1," _
& "New_ADJ_Extent_2, New_Points_2, LS_Prediction, LS_Confidence,LS_TYPE from Property_Mass "
Dim da As SqlDataAdapter = New SqlDataAdapter(strSql, cn)
' Load(DataSet)
Dim ds As DataSet = New DataSet
da.Fill(ds, "Property_Mass")
'Set up a new Data adapter Object
strSql = "select Property_Mass.Actual_Extent,Property_Mass.Attrib_code,Property_Mass.Lis_key,Property_Mass.Func_key,Property_Mass.Density," _
& " Property_Mass.New_Net_Usable_Extent,Property_Mass.New_Total_Land_Factor,Property_Mass.New_AdJ_Extent_1, Property_Mass.New_Points_1," _
& " Property_Mass.New_ADJ_Extent_2, Property_Mass.New_Points_2, Property_Mass.LS_Prediction, Property_Mass.LS_Confidence, Property_Mass.LS_TYPE," _
& " Property_Summary.Purchase_Date, Property_Summary.Purchase_Price" _
& " from Property_Mass, Property_Summary" _
& "where Substring(Lis_key,1,4)= " & txtliskeysearch.Text & "'%"""
da.SelectCommand.Parameters("Lis_key").Value = txtliskeysearch.Text
If ds.Tables("Property_Mass").Rows.Count = 0 Then
MessageBox.Show("Township not Found")
Else
da.Fill(ds)
End If
when i run the Project it gives no error, but when i search the existing "lis_key", 4 digits from 12. it throws an exception.
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll
Additional information: An SqlParameter with ParameterName 'Lis_key' is not contained by this SqlParameterCollection.
Vuyiswa Maseko
|
|
|
|
|
<response>
<result resultCount="1">
<finish>
<name>
<![CDATA[ Your Artist Player]]>
</name>
<description>
<![CDATA[ Preview your player and then copy and paste the code into your website or online profile. You may also create a new player or edit this existing player.]]>
</description>
</finish>
</result>
</response>
i have a xml file like this. my question is
what it is <![CDATA[ Your Artist Player]]>? is it a element or an attribute or what it is?
<pre></pre>
Pradeep Reddy
-- modified at 8:14 Tuesday 31st July, 2007
|
|
|
|
|
|
Hi All,
I am facing some problem in validating my xml file against the xsd.
I have used "Complexcontent" to define the type of an attribute in my XML. Incase of MSXML4.0 it is getting validated against the attached code of xsd but the same thing is failing in case of MSXML6.0.
Schema:
< ?xml version="1.0" encoding="UTF-8" standalone="no"?>
< xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
...
...
...
< xsd:complexType name="OEM">
< xsd:complexContent>
< xsd:extension base="INFO-COMPONENT"/>
< /xsd:complexContent>
< /xsd:complexType>
...
...
< xsd:complexType name="INFO-COMPONENT">
< xsd:attribute use="required" type="xsd:ID" name="ID"/>
< xsd:attribute use="optional" type="xsd:string" name="OID"/>
< /xsd:complexType>
...
...
...
< /xsd:schema>
XML:
< ?xml version="1.0" encoding="UTF-8" ?>
< ODX MODEL-VERSION="2.0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="odx.xsd">
...
...
< PARENT-REFS>
< INFO-COMPONENT DOCREF="PR_UDS" DOCTYPE="LAYER" ID-REF="PR_UDS" xsi:type="OEM" />
< /PARENT-REFS>
...
...
< /ODX>
Is any body having some solution to this?reply at the earliest its very urgent.
Thanks in advance...
Note: I have intentionally added a space after each "<" to make the code visible in this editor
Kavita seth
|
|
|
|
|
Kavita seth wrote: the same thing is failing in case of MSXML6.0
What exactly does that mean? Do you get any error message?
Kavita seth wrote: Note: I have intentionally added a space after each "<" to make the code visible in this editor
To ease things for future posts: Simply check the "Ignore HTML tags in this message" checkbox beneath the smilies.
"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
|
|
|
|
|
Hi Stefan,
Stefan Troschuetz wrote: Do you get any error message?
I am getting the reason of failure as:
"Type 'OEM' is not found in Schema"
Can you please suggest some solution for this?
Thanks in advance.
And also Thanks for your suggestion on my note.
Kavita seth
|
|
|
|
|
Kavita seth wrote: Can you please suggest some solution for this?
Mmh, I'm not sure where this error comes from as the OEM type is declared in the schema. Maybe it has something to do with declaring all schema components in the empty namespace. I strongly recommend using a custom target namespace. Also it might be helpful to see the declaration of the INFO-COMPONENT 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
|
|
|
|
|
Hello can anyone help me in getting the xml file's root node in the following format.
Here Schedule is root node.
I am using the XmlTextWriter class.
<tns:schedule xmlns:tns="http://www.Mycompany.com/Schedule" xmlns:dt="http://www.Mycompany.com/DataTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.Mycompany.com/Schedule Schedule.xsd" scheduleType="Playback" version="1.0" creationTime="2006-01-29T00:00:00" originator="Mycompany">
<scope startTime="2006-01-29T04:00:00" stopTime="2006-01-29T06:00:00" />
- <channelRef id="05" action="Noop">
<source url="ucast://192.168.3.110:10000" />
</channelRef>
Can anyone help me in this regards...
Thanks
Anee
Anee
|
|
|
|
|
Show us the code that you got so far and we'll tell you what has to be changed. Don't expect someone to write the whole code for you.
"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
|
|
|
|
|
Hello,
I did, like this.. and got the root element, in the way.. which my sample xml document contains.
But i am not much sure, that whether the method that i followed is correct or not. please help me out in fixing whether this is right or not.
This the piece of code, which i wrote to write the root node .. according to my requirement..
//writer.WriteStartElement("tns", "schedule", "http://www.MyCopmpany.com/Schedule");
writer.WriteStartElement("tns:schedule");
writer.WriteAttributeString("xmlns:tns", "", "http://www.MyCompany.com/Schedule");
writer.WriteAttributeString("xmlns:dt", "","http://www.MyCompany.com/DataTypes");
writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("xsi:schemaLocation", "http://www.MyCompany.com/Schedule Schedule.xsd");
writer.WriteAttributeString("scheduleType", "Playback");
writer.WriteAttributeString("version", "1.0");
writer.WriteAttributeString("creationTime", "2006-01-29T00:00:00");
writer.WriteAttributeString("originator", "MyCompany");
writer.WriteStartElement("scope");
writer.WriteAttributeString("startTime", "2006-01-29T04:00:00".ToString());
writer.WriteAttributeString("stopTime", "2006-01-29T06:00:00".ToString());
writer.WriteEndElement();
//use the record structure
int i = 0, count;
count = xmlSlotNodes.Count;
// sort the slots according to there callSign
xmlSlotNodes.Sort(0,count,new Sorting ());
string[] prgmTime = new string[2];
----
----
Thank you
Anee
|
|
|
|
|
Looks quite ok, but
- For starting the root element you should use the following overload of the WriteStartElement method, cause the one that is currently used expects a local name and not a qualified name:
writer.WriteStartElement("tns", "schedule", "http://www.MyCopmpany.com/Schedule");
- For writing the namespace declarations you should use the following overload, cause the one that is currently used also expects a local name and not a qualified name:
writer.WriteAttributeString("xmlns", "tns", null, "http://www.MyCompany.com/Schedule");
writer.WriteAttributeString("xmlns", "dt", null,"http://www.MyCompany.com/DataTypes");
writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("xsi", "schemaLocation", "http://www.w3.org/2001/XMLSchema-instance", "http://www.MyCompany.com/Schedule Schedule.xsd");
"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
|
|
|
|
|
Hello Stefan!!
Great thanks... Its works fine.
Thank you
Anee
Anee
|
|
|
|
|
how to connect xmlfile to tally.
i have tally software 7.2 version and rts link.
v.surendrakumar
|
|
|
|
|
Good Morning Every one,
I have an application that is going to recieve Xml file from another application via Http post.
the file structure would be as follows:
one rot node
100 childnodes and 4 childnodes for each among 100.
i am using XmlTextReader class to parse through the Xml file. the application goes on smooth as long as the structure of Xml file is correct. if there is a welformedness error in any one of the childnodes then the reader halts at that point and throws an XML error that "The starting tag doesdont match the ending tag".Once the parser encounters this error its stops reading.
I have done research and found out that XMlWellformedness eror is a fatal error and The parser is not allowed to overcome this error untill the Xmlfile structure is corrected as per the standard specifications.
i wanted to know Is there any way programaticaly that i can overcome this error!
right now im using XmlTextReader class for parsing and While loop to iterate through the nodes step by step sequentially.
I would really appreciate if some one could guide me!
Abhi Manav
|
|
|
|
|
Abhi Manav wrote: I have an application that is going to recieve Xml file from another application via Http post.
Abhi Manav wrote: the application goes on smooth as long as the structure of Xml file is correct. if there is a welformedness error in any one of the childnodes then the reader halts at that point and throws an XML error that "The starting tag doesdont match the ending tag".
Can't you fix the other app so it produces correct XML?
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Generation of Xml file is in Clients hands!
I was just trying to figure out my application in such scenarios!
Is there any way to resolve my problem?!
|
|
|
|
|
I've never seen a parser that deals with the non-wellformed XML in a way other than throwing an exception or returning an error. The syntactic wellformedness is at the very heart of XML and if your client continues to produce XML that is not wellformed he and his partners will have many problems processing these documents.
Until your client produces wellformed XML you could try to find an error-tolerant parser. If you cannot find any, you may be able to write one yourself (either generally applicable or specialized on the files you're reading). Also you may be able to write some code that deals with XML file as plain text and repairs it, so the XML parser can read it without errors.
"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 a ton for the advice!
i will work on the Xml repair API, hope it would be usefull in other cases too!
i l get back once i comeplete the thing!
Thanks!
|
|
|
|
|
Hi
I wanted to ask:
Is this possible to create a new XML file based on another XML file using XSL/XSLT?
I'm trying to build an application that can provide filtering capabilities in an XML file. I want to show the file in a TreeView such that the nodes should show the text inside the XML Tags and not the 'tag Element text'...
Thanks in advance
Rocky
|
|
|
|
|
Rocky71 wrote: Is this possible to create a new XML file based on another XML file using XSL/XSLT?
Yes, you would usually use xsl:copy and/or xsl:copy-of .
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hello,
I setup SharePoint services 3 at work so I can use its helpdesk capabilities. The problem is I want to track the number of closed service tickets for each technician. There is a built in Web Part that displays the initiated, engaged, resolved, and closed tickets. I want to add a bar for each technician that will display each of our closed tickets. The web part looks like this below. A little over half way down shows the bars where each condition will be displayed. I just want to copy a piece of that code and make a change to add the technician's closed tickets. Can anyone assist me with this?
Thanks!!
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns ="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:WebControls="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:output method="html" indent="no"/>
<xsl:param name="dvt_apos">'</xsl:param>
<xsl:variable name="dvt_1_automode">0</xsl:variable>
<xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns ="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:WebControls="Microsoft.SharePoint.WebControls">
<xsl:call-template name="dvt_1"/>
</xsl:template>
<xsl:template name="dvt_1">
<xsl:param name="ParentPath"/>
<xsl:variable name="dvt_StyleName">Table</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:variable name="dvt_RowCount" select="count($Rows)" />
<xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
<xsl:call-template name="dvt_1.footer">
<xsl:with-param name="Rows" select="$Rows" />
</xsl:call-template>
</xsl:template>
<xsl:template name="percentformat">
<xsl:param name="percent"/>
<xsl:choose>
<xsl:when test="format-number($percent, '#,##0%;-#,##0%')= 'NaN'">0%</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number($percent, '#,##0%;-#,##0%')" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="ChartRow">
<xsl:param name="RowName"></xsl:param>
<xsl:param name="Value"></xsl:param>
<xsl:param name="PercentValue"></xsl:param>
<tr>
<td class="ms-formbody" width="125px" style="vertical-align:middle">
<xsl:value-of select="$RowName"/>: <xsl:value-of select="$Value" />
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&nbsp;
</xsl:text>(<xsl:call-template name="percentformat"><xsl:with-param name="percent" select="$PercentValue"/></xsl:call-template>)
</td>
<td>
<table width="100%" >
<tr>
<td width="{round($PercentValue*100)+1}%" height="15px" class="ms-selected">
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&nbsp;</xsl:text>
</td>
<td width="100%" >
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&nbsp;</xsl:text>
</td>
</tr>
</table>
</td>
</tr>
</xsl:template>
<xsl:template name="dvt_1.footer">
<xsl:param name="ParentPath" />
<xsl:param name="Rows" />
<xsl:variable name="NotStarted" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Status) = 'Initiated'])" />
<xsl:variable name="InProgress" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Status) = 'Engaged'])" />
<xsl:variable name="Completed" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Status) = 'Resolved'])" />
<xsl:variable name="Deferred" select="count(/dsQueryResponse/Rows/Row[normalize-space(@Status) = 'Closed'])" />
<xsl:variable name="AllTasks" select="count(/dsQueryResponse/Rows/Row)" />
<xsl:variable name="percentNotStarted" select="$NotStarted div $AllTasks" />
<xsl:variable name="percentInProgress" select="$InProgress div $AllTasks" />
<xsl:variable name="percentCompleted" select="$Completed div $AllTasks" />
<xsl:variable name="percentDeferred" select="$Deferred div $AllTasks" />
<table width="100%" cellspacing="0" cellpadding="2" style="border-right: 1 solid #C0C0C0; border-bottom: 1 solid #C0C0C0; border-left-style: solid; border-left-width: 1; border-top-style: solid; border-top-width: 1;">
<xsl:call-template name="ChartRow">
<xsl:with-param name="RowName">Initiated</xsl:with-param>
<xsl:with-param name="Value"><xsl:value-of select="$NotStarted"/></xsl:with-param>
<xsl:with-param name="PercentValue"><xsl:value-of select="$percentNotStarted"/></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="ChartRow">
<xsl:with-param name="RowName">Engaged</xsl:with-param>
<xsl:with-param name="Value"><xsl:value-of select="$InProgress"/></xsl:with-param>
<xsl:with-param name="PercentValue"><xsl:value-of select="$percentInProgress"/></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="ChartRow">
<xsl:with-param name="RowName">Resolved</xsl:with-param>
<xsl:with-param name="Value"><xsl:value-of select="$Completed"/></xsl:with-param>
<xsl:with-param name="PercentValue"><xsl:value-of select="$percentCompleted"/></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="ChartRow">
<xsl:with-param name="RowName">Closed</xsl:with-param>
<xsl:with-param name="Value"><xsl:value-of select="$Deferred"/></xsl:with-param>
<xsl:with-param name="PercentValue"><xsl:value-of select="$percentDeferred"/></xsl:with-param>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="dvt_1.header">
<xsl:param name="ParentPath" />
<xsl:param name="Rows" />
<table cellSpacing="0" cellPadding="2" border="0" width="365px" >
<tr>
<td class="ms-formfieldlabel">
<p>
<strong>Overall Task Status</strong>
</p>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
|
|
|
|
|