Search Results

Search found 837 results on 34 pages for 'xsl'.

Page 24/34 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Sharepoint Designer XSLT count boolean node = true

    - by Heather Masters
    I have a SharePoint list I converted to XSLT to do some additional grouping and counting and percentages. I need to return the number of items = true within my nodeset, I have: <xsl:value-of select="count($nodeset/@PartnerArrivedAtCall)"/> (which returns the count of all the nodes) I have tried <xsl:value-of select="count($nodeset/@PartnerArrivedAtCall [@PartnerArrivedAtCall = 'Yes'])"/> (returns zero) and <xsl:variable name="ArrivedYes" select="$nodeset/@PartnerArrivedAtCall [@PartnerArrivedAtCall='Yes']"/> (also returns zero) Can you please give me a good example of how to count only the true values (in my XML, true = "Yes") Thanks!

    Read the article

  • All hail the Excel Queen

    - by Tim Dexter
    An excellent question this past week from dear ol Blighty; actually from Brian at Nextgen Clearing Ltd in the big smoke (London). Brian was developing an excel template and wanted to be able to reference the data fields multiple times inside the Excel template. Damn good question and I of course has some wacky solutions, from macros and cell referencing in Excel to pre-processing the data with an XSL stylesheet to copy the data multiple times so it could be referenced multiple times. All completely outlandish, enter our Queen of Excel, Shirley from the development team. Shirley is singlehandedly responsible for the Excel templates, I put her through six months of hell a few years back, with a host of Excel template requirements. She was more than up to the challenge and has developed some great features. One of those, is the ability to use the hidden XDO_METADATA sheet to map the data to custom named fields so they can be used multiple times in the template. So simple and very neat! Excel template and regular Excel users will know that you can only use the naming function once ie the names have to be unique across the workbook so you can not reuse a cell/group name. To get around this you can just come up with as many cell names as you want and map them in the XDO_METADATA sheet to the data columns/fields in your XML data set:. For example: XDO_?DEPTNO_SUMMARY?  <?DEPTNO?> XDO_?DNAME_SUMMARY?  <?DNAME?> XDO_GROUP_?G_D_DETAIL? <xsl:for-each-group select=".//G_D" group-by="./DEPTNO"> XDO_?DEPTNO_DETAIL? <?DEPTNO?> As you can see DEPTNO has been referenced twice and mapped to different named values in the left hand column. These values can then be used to name individual cells in the Excel template. You'll also notice a mix of Publisher <? ...?> and native XSL commands. So the world is your oyster on the mapping and the complexity you might need for calculations or string manipulation. Shirley has kindly built out a sample Excel template, data and result here so you can see how it all hangs together. the XDO_METADATA sheet is hidden, just right click on the sheet names and use the Unhide command to show it.

    Read the article

  • Overview of XSLT

    - by kaleidoscope
    XSLT (Extensible Stylesheet Language Transformations) is a declarative- XMLbased language used for the transformation of XML documents into other XML documents. Using XSLT , the original document does not changed; rather, a new document is created based on the content of an existing one. XSLT is developed by the World Wide Web Consortium (W3C).   Using XSLT we can transform source xml file into another xml file, word file or Excel file.    XSLT Functions : -   There are the following built - in XSLT functions :   Name Description current() Returns the current node document() Used to access the nodes in an external XML document element-available() Tests whether the element specified is supported by the XSLT processor format-number() Converts a number into a string function-available() Tests whether the function specified is supported by the XSLT processor generate-id() Returns a string value that uniquely identifies a specified node key() Returns a node-set using the index specified by an <xsl:key> element system-property() Returns the value of the system properties unparsed-entity-uri() Returns the URI of an unparsed entity   For more information –   http://www.w3schools.com/xsl/default.asp   Technorati Tags: Ritesh, Overview of XSLT

    Read the article

  • How to find problem with PHP XSLTProcessor when return from transformToXML is false and libxml_get_

    - by John
    I'm working on the code below to allow HTTP user agents that cannot perform XSL transformations to view the resources on my server. I'm mystified because the result of transformToXML is false, but the result of libxml_get_errors() is an empty array. As you can see, the code outputs the LibXSLT version ID and I'm getting the problem on WinVista with version 1.1.24. Is libxml_get_errors() not the right function to get the errors from the XSLTProcessor object? If you're interested in the XML documents, you can get them from http://bobberinteractive.com/index.xhtml and .../stylesheets/layout.xsl <?php //redirect browsers that can handle the source files. if (strpos ( $_SERVER ['HTTP_ACCEPT'], 'application/xhtml+xml' )) { header ( "HTTP/1.1 301 Moved Permanently" ); header ( "Location: http://" . $_SERVER ['SERVER_NAME'] . "/index.xhtml" ); header ( "Content-Type: text/text" ); echo "\nYour browser is capable of processing the <a href='/index.xhtml' site contents on its own."; die (); } //start by checking the template $baseDir = dirname ( __FILE__ ); $xslDoc = new DOMDocument (); if (! $xslDoc-load ( $baseDir . '/stylesheets/layout.xsl' )) { header ( "HTTP/1.1 500 Server Error" ); header ( "Content-Type: text/plain" ); echo "\n Can't load " . $baseDir . '/stylesheets/layout.xsl'; die (); } //resolve the requested resource (browsers that need transformation will request the resource without the suffix) $uri = $_SERVER ['REQUEST_URI']; $len = strlen ( $uri ); if (1 = $len || '/' == substr ( $uri, $len - 1 )) { $fileName = $baseDir . "/index.xhtml"; // use 'default' document if pathname ends in '/' } else { $fileName = $baseDir . (1 load ( $fileName )) { header ( "HTTP/1.1 500 Server Error" ); echo "\n Can't load " . $fileName; die (); } // now start the XSL template processing $proc = new XSLTProcessor (); $proc-importStylesheet ( $xslDoc ); $doc = $proc-transformToXML ( $xmlDoc ); if (false === $doc) { header ( "HTTP/1.1 500 Server Error" ); header ( "Content-Type: text/plain" ); echo "\n"; // HERE is where it gets strange: the value of $doc is false and libxml_get_errors returns 0 entries. display_xml_errors ( libxml_get_errors() ); die (); } header ( "Content-Type: text/html" ); echo "\n"; echo $doc; function display_xml_errors($errors) { echo count ( $errors ) . " Error(s) from LibXSLT " . LIBXSLT_DOTTED_VERSION; for($i = 0; $i level) { case LIBXML_ERR_WARNING : $return .= "Warning $error-code: "; break; case LIBXML_ERR_ERROR : $return .= "Error $error-code: "; break; case LIBXML_ERR_FATAL : $return .= "Fatal Error $error-code: "; break; } $return .= trim ( $error-message ) . "\n Line: $error-line" . "\n Column: $error-column"; if ($error-file) { $return .= "\n File: $error-file"; } echo "$return\n\n--------------------------------------------\n\n"; } }

    Read the article

  • How to concatenate the contents of all children of a node in XPath?

    - by Brian
    Is it possible with XPath to get a concatenated view of all of the children of a node? I am looking for something like the JQuery .html() method. For example, if I have the following XML: <h3 class="title"> <span class="content">this</span> <span class="content"> is</span> <span class="content"> some</span> <span class="content"> text</span> </h3> I would like an XPath query on "h3[@class='title']" that would give me "this is some text". That is the real question, but if more context/background is helpful, here it is: I am using XPath and I used this post to help me write some complex XSL. My source XML looks like this. <h3 class="title">Title</h3> <p> <span class="content">Some</span> <span class="content"> text</span> <span class="content"> for</span> <span class="content"> this</span> <span class="content"> section</span> </p> <p> <span class="content">Another</span> <span class="content"> paragraph</span> </p> <h3 class="title"> <span class="content">Title</span> <span class="content"> 2</span> <span class="content"> is</span> <span class="content"> complex</span> </h3> <p> <span class="content">Here</span> <span class="content"> is</span> <span class="content"> some</span> <span class="content"> text</span> </p> My output XML considers each <h3> as well as all <p> tags until the next <h3>. I wrote the XSL as follows: <xsl:template match="h3[@class='title']"> ... <xsl:apply-templates select="following-sibling::p[ generate-id(preceding-sibling::h3[1][@class='title'][text()=current()/text()]) = generate-id(current()) ]"/> ... </xsl:template> The problem is that I use the text() method to identify h3s that are the same. In the example above, the "Title 2 is complex" title's text() method returns whitespace. My thought was to use a method like JQuery's .html that would return me "Title 2 is complex"

    Read the article

  • Moodle serves on IP only - will not work with mod_proxy

    - by Jon H
    I'm trying to set a moodle server up on an Ubuntu box, which already serves Plone & Trac via Apache. In my Moodle config I have $CFG-wwwroot = 'http://www.server-name.org/moodle' The configuration below works fine for the first two, but when I visit www.server-name.com/moodle I get: Incorrect access detected, this server may be accessed only through "http://xxx.xxx.xxx.xxx:8888/moodle" address, sorry It then forwards to the IP address, where Moodle functions fine. What am I missing to get the server name approach working correctly? Apache Config follows: LoadModule transform_module /usr/lib/apache2/modules/mod_transform.so Listen 8080 Listen 8888 Include /etc/phpmyadmin/apache.conf <VirtualHost xxx.xxx.xxx.xxx:8080> <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost On <Location /> ProxyPass http://127.0.0.1:8082/ ProxyPassReverse http://127.0.0.1:8082/ </Location> </VirtualHost> <VirtualHost xxx.xxx.xxx.xxx:80> ServerName www.server-name.org ServerAlias server-name.org ProxyRequests Off FilterDeclare MyStyle RESOURCE FilterProvider MyStyle XSLT resp=Content-Type $text/html TransformOptions +ApacheFS +HTML TransformCache /theme.xsl /home/web/webapps/plone/theme.xsl TransformSet /theme.xsl FilterChain MyStyle ProxyPass /issue-tracker ! ProxyPass /moodle ! <Location /issue-tracker/login> AuthType Basic AuthName "Trac" AuthUserFile /home/web/webapps/plone/parts/trac/trac.htpasswd Require valid-user </Location> Alias /moodle /usr/share/moodle/ <Directory /usr/share/moodle/> Options +FollowSymLinks AllowOverride None order allow,deny allow from all <IfModule mod_dir.c> DirectoryIndex index.php </IfModule> </Directory> </VirtualHost>

    Read the article

  • Docbook-xslt chapter id matching

    - by Jerry Jacobs
    Dear all, I would like to write a xslt rule if it matches a certain chapter ID that it sets autolabel to zero on the section. in pseudo code: IF CHAPTER == LOGBOOK SECTION.AUTOLABEL = 0 ELSE SECTION.AUTOLABEL = 1 ENDIF But after reading the docbook xsl website and docbook xsl reference i'm still unable to figure out how to do it. Maybe someone can push me in the right direction, because i'm new in docbook and xls(t) Kind regards, Jerry

    Read the article

  • Test first subnode from node.

    - by Kalinin
    XML: <cont> <mode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> </mode> <mode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> </mode> <mode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> <submode>lorem ipsum</submode> </mode> </cont> How to test first <submode> from each <mode> in such construction: <xsl:template match="submode"> <xsl:if test="(parent::mode) and (...what?...)"> ... </xsl:if> ... </xsl:template> I do not understand how use position() here.

    Read the article

  • XSLT: opening but not closing tags

    - by farhad
    Is there a way to open a tag and not close it? For example: <xsl:for-each select="."> <span> </xsl:for-each> This piece of code is not valid because XSLT is not well formed, but is there a way to do a similar thing? Thank you

    Read the article

  • XmlDataProvider and XPath bindings don't allow default namespace of XML data?

    - by Andy Dent
    I am struggling to work out how to use default namespaces with XmlDataProvider and XPath bindings. There's an ugly answer using local-name <Binding XPath="*[local-name()='Name']" /> but that is not acceptable to the client who wants this XAML to be highly maintainable. The fallback is to force them to use non-default namespaces in the report XML but that is an undesirable solution. The XML report file looks like the following. It will only work if I remove xmlns="http://www.acme.com/xml/schemas/report so there is no default namespace. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type='text/xsl' href='PreviewReportImages.xsl'?> <Report xsl:schemaLocation="http://www.acme.com/xml/schemas/report BlahReport.xsd" xmlns:xsl="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.acme.com/xml/schemas/report"> <Service>Muncher</Service> <Analysis> <Date>27 Apr 2010</Date> <Time>0:09</Time> <Authoriser>Service Centre Manager</Authoriser> Which I am presenting in a window with XAML: <Window x:Class="AcmeTest.ReportPreview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="ReportPreview" Height="300" Width="300" > <Window.Resources> <XmlDataProvider x:Key="Data"/> </Window.Resources> <StackPanel Orientation="Vertical" DataContext="{Binding Source={StaticResource Data}, XPath=Report}"> <TextBlock Text="{Binding XPath=Service}"/> </StackPanel> </Window> with code-behind used to load an XmlDocument into the XmlDataProvider (seems the only way to have loading from a file or object varying at runtime). public partial class ReportPreview : Window { private void InitXmlProvider(XmlDocument doc) { XmlDataProvider xd = (XmlDataProvider)Resources["Data"]; xd.Document = doc; } public ReportPreview(XmlDocument doc) { InitializeComponent(); InitXmlProvider(doc); } public ReportPreview(String reportPath) { InitializeComponent(); var doc = new XmlDocument(); doc.Load(reportPath); InitXmlProvider(doc); } }

    Read the article

  • xslt reading multiple instances of a tag

    - by shashank saket
    hello, my xml file is smth like this.. now in my xsl sheet i need to retrieve the values of all the "j.0:property" tags.. i am using something like this: </xsl:template> but then it returns the same value 3 times..the value being the value of the first property encountered.. kindly help as to how i can get the value for each property.

    Read the article

  • Pattern Matching with XSLT

    - by genesis11
    I'm trying to match a pattern into a string in XSLT/XPath using the matches function, as follows: <xsl:when test="matches('awesome','awe')"> ... </xsl:when> However, in both Firefox 3.5.9 and IE8, it doesn't show up. IE8 tells me that "'matches' is not a valid XSLT or XPath function." Is this due to XSLT 2.0 not being supported, and is there a way around this?

    Read the article

  • Generate dynamic xmlns

    - by alexbf
    Hello, I would like to dynamically generate xmlns attributes. I want to generate this in XSL : <Common:MainPageBase xmlns:Common="clr-namespace:ThisPartIsDynamic;assembly=ThisPartIsDynamic" </Common:MainPageBase How can I do that in XSL? Thanks, Alex

    Read the article

  • xslt or php for rendering output

    - by Arsenal
    I'm creating something where users can upload an xml and data get's imported to the database. Now I'm building some kind of a preview page where users will get to see how their input will look once it's stored. What would be the fastest (in execution time), using XSL to transform the xml to a html page, or using php to render the output? My guess is XSL is far more suitable (+ faster) for this (and by using a DTD there's no need for code written validation, right?)

    Read the article

  • Nokogiri (Ruby) and XPath

    - by JP
    Does Nokogiri only support XPath 1.0? I'm trying to do simple string replacement in a value-of cell, like so (where element contains something like '* My string (useless text)') <xsl:value-of select="replace(element,'^\*\ (.+)\ \(.*\)$','\\1')"> Is this poorly formed XSL? Or is there a limitation with Nokogiri?

    Read the article

  • How can I make XSLT work in chrome?

    - by Eric
    I have an XML document here that is served with a corresponding XSL file. The transformation is left to be executed client-side, without JavaScript. This works fine in IE (shock horror), but in Google Chrome, just displays the document's text nodes. I know that it is possible to do client-side XSL in Chrome, as I have seen examples of it, but I am yet to be able to replicate this success myself What am I doing wrong?

    Read the article

  • Use spring tag in XSLT

    - by X-Pippes
    I have a XSL/XML parser to produce jsp/html code. Using MVC model I need to accees spring library in order to perform i18n translation. Thus, given the xml <a> ... <country>EN</country> ... </a> and using <spring:message code="table_country_code.EN"/> tag, choose based on the browser language, the transalation into England, Inglaterra, etc... However, the XSL do not support <spring:message> tag. The idea is to have a XSLT with something like this <spring:message code="table_country_code.><xsl:value-of select="country"/>"/>` I also tried to create the spring tag in Java when I make a parse to create the XML but I sill have the same error. ERROR [STDERR] (http-0.0.0.0-8080-1) file:///C:/Software/Jboss/jboss-soa-p-5/jboss-as/bin/jstl:; Line #5; Column #58; The prefix "spring" for element "spring:message" is not bound. How can I resolve?

    Read the article

  • How do you pass .net objects values around in F#?

    - by Russell
    I am currently learning F# and functional programming in general (from a C# background) and I have a question about using .net CLR objects during my processing. The best way to describe my problem will be to give an example: let xml = new XmlDocument() |> fun doc -> doc.Load("report.xml"); doc let xsl = new XslCompiledTransform() |> fun doc -> doc.Load("report.xsl"); doc let transformedXml = new MemoryStream() |> fun mem -> xsl.Transform(xml.CreateNavigator(), null, mem); mem This code transforms an XML document with an XSLT document using .net objects. Note XslCompiledTransform.Load works on an object, and returns void. Also the XslCompiledTransform.Transform requires a memorystream object and returns void. The above strategy used is to add the object at the end (the ; mem) to return a value and make functional programming work. When we want to do this one after another we have a function on each line with a return value at the end: let myFunc = new XmlDocument("doc") |> fun a -> a.Load("report.xml"); a |> fun a -> a.AppendChild(new XmlElement("Happy")); a Is there a more correct way (in terms of functional programming) to handle .net objects and objects that were created in a more OO environment? The way I returned the value at the end then had inline functions everywhere feels a bit like a hack and not the correct way to do this. Any help is greatly appreciated!

    Read the article

  • Resolve sibling folder in JavaScript Function

    - by Jamen Chu
    Hi, I am trying to pass into an JavaScript function two paths for an XML and XSLT. It would appear that in the sample HTML below that the use of "../xsl/filename" does not work for me in the xslt() function. If I specify the path as being "./filename" though this does work. Does anyone know how I can work around this or find some way that I can specify a sibling folder without an absolute path reference? I would prefer not to have to change my file paths as my development environment is set up with the xslt's, sample data and source code structured in a particular way. Thanks in advance Jamen <html> <head> <title></title> <script type="text/javascript" src="../lib/jsunit/app/jsUnitCore.js"></script> <script type="text/javascript" src="../lib/jquery-1.2.3.js"></script> <script type="text/javascript" src="../lib/jquery.xslt.js"></script> </head> <body> <div id="bla"></div> <script type="text/javascript"> $('#bla').xslt("../sampledata/response1.xml", "../xslt/resultFormatter.xsl"); //function testjQuery() { // $('#bla').xslt("../sampledata/response1.xml", "../xslt/resultFormatter.xsl"); //} </script> </body> </html>

    Read the article

  • XSLT how to merge some lists of parameters

    - by buggy1985
    Hi, I have an URL Structure like this: http://my.domain.com/generated.xml?param1=foo&param2=bar&xsl=path/to/my.xsl The generated XML will be transformed using the given XSL Stylesheet. The two other parameters are integrated too like this: <root> <params> <param name="param1">foo</param> <param name="param2">bar</param> </param> ... </root> Now I want to create with XSLT a link with a new URI that keeps the existing parameters and adds one or multiple new parameters like page=3 or sort=DESC. If the given parameter already exists, it should be replaced. I'm not sure how to do this. How to pass multiple (optional) parameters to a template. How to merge two lists of parameters. Any ideas? Thanks ;)

    Read the article

  • Combining XmlWriter objects?

    - by Kevin
    The way my application is structured, each component generates output as XML and returns an XmlWriter object. Before rendering the final output to the page, I combine all XML and perform an XSL transformation on that object. Below, is a simplified code sample of the application structure. Does it make sense to combine XmlWriter objects like this? Is there a better way to structure my application? The optimal solution would be one where I didn't have to pass a single XmlWriter instance as a parameter to each component. function page1Xml() { $content = new XmlWriter(); $content->openMemory(); $content->startElement('content'); $content->text('Sample content'); $content->endElement(); return $content; } function generateSiteMap() { $sitemap = new XmlWriter(); $sitemap->openMemory(); $sitemap->startElement('sitemap'); $sitemap->startElement('page'); $sitemap->writeAttribute('href', 'page1.php'); $sitemap->text('Page 1'); $sitemap->endElement(); $sitemap->endElement(); return $sitemap; } function output($content) { $doc = new XmlWriter(); $doc->openMemory(); $doc->writePi('xml-stylesheet', 'type="text/xsl" href="template.xsl"'); $doc->startElement('document'); $doc->writeRaw( generateSiteMap()->outputMemory() ); $doc->writeRaw( $content->outputMemory() ); $doc->endElement(); $doc->endDocument(); $output = xslTransform($doc); return $output; } $content = page1Xml(); echo output($content); Update: I may abandon XmlWriter altogether and use DomDocument instead. It is more flexible and it also seemed to perform better (at least on the crude tests I created).

    Read the article

  • Adding a variable href attribute to a hyperlink using XSLT

    - by Pete
    I need to create links using dynamic values for both the URL and the anchor text. I have column called URL, which contains URL's, i.e., http://stackoverflow.com, and I have a column called Title, which contains the text for the anchor, i.e., This Great Site. I figure maybe all I need to do is nest this tags, along with a little HTML to get my desired result: <a href="> <xsl:value-of select="@URL">"> <xsl:value-of select="@Title"/> </xsl:value-of> </a> In my head, this would render: <a href=" http://stackoverflow.com"> This Great Site </a> I know there's more to it, but I haven't been able to clearly understand what more I need. I think this issue has been addressed before, but not in a way I could understand it. I'd be more than happy to improve the question's title to help noobs like myself find this item, and hopefully an answer. Any help is greatly appreciated.

    Read the article

  • How can I dynamically set the default namespace declaration of an XSLT transformation's output XML?

    - by Paralife
    I can do it, but not for the default namespace, using the <xsl:namespace>. If I try to do it for the default namespace: <xsl:namespace name="" select"myUri"/> it never works. It demands that I explicitly define the namespace of the element to be able to use the above null prefix declaration. The reason I want this is because I have a task to transform an input XML file to another output xml. The output XML has many elements and i dont want to have to explicitly set the namespace for every element. Thats why I want to set the default and never bother again. But the default must be computed from some data in the source XML. It does not change during the whole transformation, but it is dependent on input XML data. Any solution? EDIT 1: To sup up: I want to create a namespace dynamically and set it to be the default namespace of the output xml document. The uri of the namespace is derived from some data in the input XML. If I use <xsl:namespace> in my root output element, I cannot create a default namespace for it, only a prefixed one. And even with the prefixed one, it does not propagate to children.

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >