16 2890
Do either of these work? - <xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster"> OR
-
-
<xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[contains(.,'contoso.microsoft.com')]">
-
The first option you gave me pulled all of the servers even the ones with different FQDN's . I get the error below for the 2nd option you gave me: - [Unknown method. DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[-->contains(.<--,'exch...
Tried the below XSLT Stylesheet -
<?xml version='1.0'?>
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
-
<xsl:template match="/">
-
<html>
-
<body>
-
<body bgcolor="Silver">
-
</body>
-
<h2>Exchange Server Information</h2>
-
<table border="3">
-
<tr bgcolor="yellow">
-
<th>Exchange Servers</th>
-
<th>Replication Required</th>
-
<th>Setup Required</th>
-
<th>Network Interface</th>
-
<th>IP Address</th>
-
</tr>
-
<xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[contains(.,'contoso.microsoft.com')]|
-
DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster/Machine/NetInterface[@IPAddress='1.1.1.1']|
-
DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster/Machine/NetInterface[@IPAddress='2.2.2.2']|
-
DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster/Machine/NetInterface[@IPAddress='3.3.3.3']">
-
<tr>
-
-
<td><xsl:value-of select="@Fqdn"/></td>
-
<td><xsl:value-of select="@RequiresReplication"/></td>
-
<td><xsl:value-of select="@RequiresSetup"/></td>
-
<td><xsl:value-of select="@InterfaceSide"/></td>
-
<td><xsl:value-of select="@IPAddress"/></td>
-
</tr>
-
</xsl:for-each>
-
</table>
-
</body>
-
</html>
-
</xsl:template>
-
</xsl:stylesheet>
-
Are you using MSXML 3 or earlier? How are you running the transformation?
You may need to set something like:
oXMLDoc.setProperty("SelectionLanguage", "XPath");
Is substring-after supported?, eg: -
<xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[substring-after(@Fqdn,'.') = 'contoso.microsoft.com']">
-
I'm not 100% sure if I'm running MSXML 3 or earlier. When I open the XML document it says "<?xml version="1.0" encoding="utf-8" ?> " at the top.
I'm taking an XML document that someone gave me and making an XSL stylesheet so that the XML document can be visable in a template format. I'll open the XML doc in notepad and point it to my XSL document and save it. Then I'll customize my XSL document. When I open the XML document it will display the data.
Below is the info I added to my last XSL document that you sent me last. -
<?xml version='1.0'?>
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
-
<xsl:template match="/">
-
<html>
-
<body>
-
<body bgcolor="Silver">
-
</body>
-
<h2>Exchange Server Information</h2>
-
<table border="3">
-
<tr bgcolor="yellow">
-
<th>Exchange Servers</th>
-
<th>Replication Required</th>
-
<th>Setup Required</th>
-
<th>Network Interface</th>
-
<th>IP Address</th>
-
</tr>
-
<xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[substring-after(@Fqdn,'.')='contoso.microsoft.com']|
-
-
DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster/Machine/NetInterface[@IPAddress='157.54.98.16']|
-
DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster/Machine/NetInterface[@IPAddress='157.54.61.141']|
-
DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster/Machine/NetInterface[@IPAddress='10.31.127.204']">
-
<tr>
-
-
<td><xsl:value-of select="@Fqdn"/></td>
-
<td><xsl:value-of select="@RequiresReplication"/></td>
-
<td><xsl:value-of select="@RequiresSetup"/></td>
-
<td><xsl:value-of select="@InterfaceSide"/></td>
-
<td><xsl:value-of select="@IPAddress"/></td>
-
</tr>
-
</xsl:for-each>
-
</table>
-
</body>
-
</html>
-
</xsl:template>
-
</xsl:stylesheet>
-
use code tags to display all your code:
[code] . . . . [/code]
kub365 I'm not sure what you mean by code tags? I'm very new to this site and XML and XSL. Sorry for the troubles.
If you change your stylesheet element to:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
does it work?
code tags [code] [/code]
Represented by the # in the quick reply box, next to quote
jkmyoung
I get the below when I use the code below: Also see first picture for outcome. - <xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[substring-after(@Fqdn,'.') = 'contoso.microsoft.com']">
Stylesheet - <<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
<xsl:template match="/">
-
<html>
-
<body>
-
<body bgcolor="Silver">
-
</body>
-
<h2>Exchange Server Information</h2>
-
<table border="3">
-
<tr bgcolor="yellow">
-
<th>Exchange Servers</th>
-
<th>Replication Required</th>
-
<th>Setup Required</th>
-
<th>Network Interface</th>
-
<th>IP Address</th>
-
</tr>
-
<xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[substring-after(@Fqdn,'.') = 'contoso.microsoft.com']">
-
<tr>
-
-
<td><xsl:value-of select="@Fqdn"/></td>
-
<td><xsl:value-of select="@RequiresReplication"/></td>
-
<td><xsl:value-of select="@RequiresSetup"/></td>
-
<td><xsl:value-of select="@InterfaceSide"/></td>
-
<td><xsl:value-of select="@IPAddress"/></td>
-
</tr>
-
</xsl:for-each>
-
</table>
-
</body>
-
</html>
-
</xsl:template>
-
</xsl:stylesheet>
-
When I use code: - <xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[contains(.,'contoso.microsoft.com')]">
I get the same output as my other screenshoot. Stylesheet used: -
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
<xsl:template match="/">
-
<html>
-
<body>
-
<body bgcolor="Silver">
-
</body>
-
<h2>Exchange Server Information</h2>
-
<table border="3">
-
<tr bgcolor="yellow">
-
<th>Exchange Servers</th>
-
<th>Replication Required</th>
-
<th>Setup Required</th>
-
<th>Network Interface</th>
-
<th>IP Address</th>
-
</tr>
-
<xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[contains(.,'contoso.microsoft.com')]">
-
-
-
<tr>
-
-
<td><xsl:value-of select="@Fqdn"/></td>
-
<td><xsl:value-of select="@RequiresReplication"/></td>
-
<td><xsl:value-of select="@RequiresSetup"/></td>
-
<td><xsl:value-of select="@InterfaceSide"/></td>
-
<td><xsl:value-of select="@IPAddress"/></td>
-
</tr>
-
</xsl:for-each>
-
</table>
-
</body>
-
</html>
-
</xsl:template>
-
</xsl:stylesheet>
-
Do I need to change my XML sheet as well? It shows that its using.
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="DocItemSetV10.xsl"?>
Gabe
I made a mistake in the original posting:
contains(.,'contoso.microsoft.com')]">
should be
contains(@Fqdn,'contoso.microsoft.com')]">
To execute these stylesheets, you are simply opening the xml in an internet browser window correct? Which browser are you using?
Yes, I'm opening the xml in an Internet browser window. The browser I'm using is Internet Explorere 8.
When I add - <xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[contains(@Fqdn,'exchange.corp.microsoft.com')]">
I get the same output as in my last screenshot. Below is the Stylesheet I'm using. (Does it look correct?) -
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
<xsl:template match="/">
-
<html>
-
<body>
-
<body bgcolor="Silver">
-
</body>
-
<h2>Exchange Server Information</h2>
-
<table border="3">
-
<tr bgcolor="yellow">
-
<th>Exchange Servers</th>
-
<th>Replication Required</th>
-
<th>Setup Required</th>
-
<th>Network Interface</th>
-
<th>IP Address</th>
-
</tr>
-
<xsl:for-each select="DocItemSet/DocItem/Data/AnchoredXml/Dictionary/Item/Value/Topology/Clusters/Cluster[contains(@Fqdn,'contoso.microsoft.com')]">
-
<tr>
-
-
<td><xsl:value-of select="@Fqdn"/></td>
-
<td><xsl:value-of select="@RequiresReplication"/></td>
-
<td><xsl:value-of select="@RequiresSetup"/></td>
-
<td><xsl:value-of select="@InterfaceSide"/></td>
-
<td><xsl:value-of select="@IPAddress"/></td>
-
</tr>
-
</xsl:for-each>
-
</table>
-
</body>
-
</html>
-
</xsl:template>
-
</xsl:stylesheet>
-
@jkmyoung
jkmyoung
I’m still having some issues with this one. I still can’t pull out the exchange servers by name.
Thanks,
Gabe
Please try visiting http://www.bayes.co.uk/xml/index.xml...ml_sniffer.htm
to determine the version of msxml you have.
In order to be able to use contains, you might have to install an msxml upgrade.
If you have other clients that use this, you may need to provide a disclaimer that they must have msxml of some version installed, or be using a different browser.
According to this page: http://support.microsoft.com/kb/304265 contains is available once you have the appropriate updates.
@jkmyoung
I went to the site http://www.bayes.co.uk/xml/index.xml...ml_sniffer.htm and received the below output (See screenshot).
In the screenshoot it says "Although you have the new version of MSXML you are running it in "side-by-side" mode. To get the full benifits of this new version you should run xmlinst (from Microsoft to switch to "replace" mode."
Do I need to run it in replace mode? Could this affect some of my other changes that I have created in my stylesheet?
Thankls,
Gabe
Sorry, this goes beyond my expertise. I would like to help; however, these nuances are quite obscure, and it's hard to find people with similar working experience. Hope you can find what you're looking for.
Jkmyoung
I'm now running version 3 of MSXML2 in "Replace" mode. Is this the version that you are running? Please see attachments?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ralf Wahner |
last post by:
Dear Masters of XSLT
Could I ask you for a clue on the following question? I'd
like to use XSLT to transform an XML source file to LaTeX.
In the following small example the <para> Element...
|
by: Geathaa |
last post by:
Hi everyone,
I want to transform a xml document containing the description of a
menu tree to HTML. The MenuTree XML contains the target URL for each
tree node. Some URL's contain parameters...
|
by: discomiller |
last post by:
Mario Mueller:
Hello *,
radiobuttons belong to other radiobuttons by the "name="any_value""
attribut.
Thats a fakt.
I got the following XML:...
|
by: Jim Garrison |
last post by:
I know how to use the name() function to access the name of the
current node. How do I get the 'fully qualified' name, consisting
of the path from the root to the current node?
I.e.
<a>
<b>...
|
by: ina |
last post by:
Hello all,
I am newbie in xml and have a problem with this parse.
I have this xml.file
<Style>
<Strategy>
|
by: gregmcmullinjr |
last post by:
Hi All,
I would like to use XSLT to replace all <unodes that are children of
a <bnode with a new <headingnode. Also, if the <bnode has no
other children than remove it as well.
For example:
...
|
by: lanegroups |
last post by:
Dear experts,
I'm trying to do the following using Xalan-C++ API
1. parse an XML document
2. evaluate an XML path
3. serialize the selected XML subtree
4. The new serialized XML fragment should...
|
by: redgrL86 |
last post by:
Hi,
I am trying to figure out how to see if any of a given set of childnodes equals a given string. For example, in the XML and XSL code below, I want the text in the "xsl:when" statement to output...
|
by: SkipNRun |
last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list.
...
|
by: Ebenezer |
last post by:
Let's suppose I have some nodes in an XML file, with an URL attribute:
<node url="mypage.php?name1=value1&foo=bar&foo2=bar2&name2=value0" />
<node...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |