Search Results

Search found 1068 results on 43 pages for 'xsl fo'.

Page 20/43 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Split node list to parts.

    - by Kalinin
    xml: <mode>1</mode> <mode>2</mode> <mode>3</mode> <mode>4</mode> <mode>5</mode> <mode>6</mode> <mode>7</mode> <mode>8</mode> <mode>9</mode> <mode>10</mode> <mode>11</mode> <mode>12</mode> i need to separate it on parts (for ex. on 4): xslt: <xsl:variable name="vNodes" select="mode"/> <xsl:variable name="vNumParts" select="4"/> <xsl:variable name="vNumCols" select="ceiling(count($vNodes) div $vNumParts)"/> <xsl:for-each select="$vNodes[position() mod $vNumCols = 1]"> <xsl:variable name="vCurPos" select="(position()-1)*$vNumCols +1"/> <ul> <xsl:for-each select="$vNodes[position() >= $vCurPos and not(position() > $vCurPos + $vNumCols -1)]"> <li><xsl:value-of select="."/></li> </xsl:for-each> </ul> </xsl:for-each> this code is written by Dimitre Novatchev - great coder)) but for the number of nodes less then number of parts (for ex. i have 2 modes) this code does not work - it outputs nothing. How it upgrade for that case (without choose construction)?

    Read the article

  • Cannot select a node here: the context item is an atomic value

    - by user348810
    While i execute this code it shownt the following error Cannot select a node here: the context item is an atomic value,so that i can't sum up the fundunits what is the problem ? why i can't able to sum up <xsl:variable name="VAR_FUNDNAME" select="distinct-values(/SJPDATA/WEALTHSTAT[DOCUMENTTYPE=$MYDCTTYPE]/CLIENTINFO[CLIENTID=$MYCLIENT]/ancestor::*/PORTFOLIO/PENSIONS[CLIENTREF=$MYCLIENTTYPE][GROUPING=$MYGROUPINGVALUE]/PENSIONBREAKDOWN/FUNDNAME)"/> <xsl:for-each select="$VAR_FUNDNAME"> <xsl:variable name="VAR_CURFUNDNAME" select="."/> <myvar><xsl:value-of select="$VAR_CURFUNDNAME"/></myvar> <xsl:if test="(/SJPDATA/WEALTHSTAT[DOCUMENTTYPE=$MYDCTTYPE]/CLIENTINFOCLIENTID=$MYCLIENT]/ancestor::*/PORTFOLIO/PENSIONS[CLIENTREF=$MYCLIENTTYPE][GROUPING=$MYGROUPINGVALUE]/PENSIONBREAKDOWN[FUNDNAME=string($VAR_CURFUNDNAME)][UNITTYPE='Acc'])"/> <ASSETVALUATIONDATE><xsl:value-of select="min(/SJPDATA/WEALTHSTAT[DOCUMENTTYPE=$MYDCTTYPE]/CLIENTINFO[CLIENTID=$MYCLIENT]/ancestor::*/PORTFOLIO/PENSIONS[CLIENTREF=$MYCLIENTTYPE][GROUPING=$MYGROUPINGVALUE]/PENSIONBREAKDOWN[FUNDNAME=string($VAR_CURFUNDNAME)][UNITTYPE='Acc']/string(ASSETVALUATIONDATE))"/></ASSETVALUATIONDATE> <PLANNUMBER></PLANNUMBER> <FUNDNAME><xsl:value-of select="$VAR_CURFUNDNAME"/></FUNDNAME> <FUNDUNITS><xsl:value-of select="string(sum(/SJPDATA/WEALTHSTAT[DOCUMENTTYPE=$MYDCTTYPE]/CLIENTINFO[CLIENTID=$MYCLIENT]/ancestor::*/PORTFOLIO/PENSIONS[CLIENTREF=$MYCLIENTTYPE][GROUPING=$MYGROUPINGVALUE]/PENSIONBREAKDOWN[FUNDNAME=string($VAR_CURFUNDNAME)][UNITTYPE='Acc']/FUNDUNITS))"/></FUNDUNITS> </xsl:for-each>

    Read the article

  • string comparison xslt sheet

    - by dbomb101
    I am trying to compare a value which was grabbed using the get method in a form and then passed into a xslt sheet. I named the string variable passed in browse. I want to check if the variable browse has a string value browse. the code is below <xsl:if test="$browse = 'browse' "> <A> <xsl:attribute name="href">searchPage.php?search=<xsl:value-of select="$search" />&amp;browseButton=Browse&amp;XML=Xml&amp;page=<xsl:value-of select="number($Page)-1"/>&amp;pagesize=<xsl:value-of select="$PageSize"/></xsl:attribute> &lt;&lt;Prev </A> </xsl:if>

    Read the article

  • using document() function in .NET XSLT generates error

    - by Simon
    I'd like to use embedded resources in my XSLT file, but while invoking 'document(...)' C# complains that "Error during loading document ..." I'd like to use defined resources in XSLT file and get them by this: "document('')//my:resources/"... How can i do that?? ex xsl: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="xslt-gruper-v1.2.xsl" exclude-result-prefixes="my"> <my:resources> <one>tryb</one> </my:resources> <xsl:variable name="res" select="document('')/*/my:resources/("/> </xsl:stylesheet> How can i get access to such structure without exceptions in C#? I'll add that during static transform via ex. Opera everything works fine.

    Read the article

  • How to put tags inside an html attribute?

    - by Mycol
    Using xslt i want to create an attribute: <span class="tooltip"> <xsl:attribute name="onmouseover"> <xsl:text>javascript:function(</xsl:text> <span class="label">Aggiunta</span> <xsl:apply-tempaltes/> <xsl:text>)</xsl:text> </xsl:attribute> The problem is that only the pure text is putted inside the attribute, like <span class="tooltip" onmouseover="javascript:function(Aggiunta ...)"> whithout the span tags or the tags that may come from apply-templates. So how can I put html code into an attribute?

    Read the article

  • Messing with Encoding and XslCompiledTransform

    - by Josemalive
    Hello, im messing with the encodings. For one hand i have a url that is responding me in UTF-8 (im pretty sure thanks to firebug plugin). Im opening the url reading the content in UTF-8 using the following code: StreamReader reader = new StreamReader(response.GetResponseStream(),System.Text.Encoding.UTF8); For other hand i have a transformation xslt sheet with the following code: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="xml" indent="yes"/> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> <br/> hello </xsl:copy> </xsl:template> </xsl:stylesheet> This xslt sheet is saved in UTF-8 format too. I use the following code to mix the xml with the xslt: StringWriter writer = new StringWriter(); XslCompiledTransform transformer = new XslCompiledTransform(); transformer.Load(HttpContext.Current.Server.MapPath("xslt\\xsltsheet.xslt"); XmlWriterSettings xmlsettings = new XmlWriterSettings(); xmlsettings.Encoding = System.Text.Encoding.UTF8; transformer.Transform(xmlreader, null, writer); return writer; Then after all im render in the webbrowser the content of this writer and im getting the following error: The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Switch from current encoding to specified encoding not supported. Error processing resource 'http://localhost:2541/Results.... <?xml version="1.0" encoding="utf-16"?> Im wondering where is finding the UTF-16 encoding take in count that: All my files are saved as UTF-8 The response from the server is in UTF-8 The way of read the xslt sheet is configured as UTF-8. Any help would be appreciated. Thanks in advance. Best Regards. Jose.

    Read the article

  • XSLT: Display unique rows of filtered XML recordset

    - by Chris G.
    I've got a recordset that I'm filtering on a particular field (i.e. Manager ="Frannklin"). Now I'd like to group the results of that filtered recordset based on another field (Client). I can't seem to get Muenchian grouping to work right. Any thoughts? TIA! CG My filter looks like this: <xsl:key name="k1" match="Row" use="@Manager"/> <xsl:param name="dvt_filterval">Frannklin</xsl:param> <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" /> <xsl:variable name="FilteredRowsAttr" select="$Rows[normalize-space(@*[name()=$FieldNameNoAtSign])=$dvt_filterval ]" /> Templates <xsl:apply-templates select="$FilteredRowsAttr[generate-id() = generate-id(key('k1',@Manager))]" mode="g1000a"> </xsl:apply-templates> <xsl:template match="Row" mode="g1000a"> Client: <xsl:value-of select="@Client"/> </xsl:template> Results I'm getting Client: Beta Client: Beta Client: Beta Client: Gamma Client: Delta Results I want Client: Beta Client: Gamma Client: Delta Sample recordset <dsQueryResponse> <Rows> <Row Manager="Smith" Client="Alpha " Project_x0020_Name="Annapolis" PM_x0023_="00123" /> <Row Manager="Ford" Client="Alpha " Project_x0020_Name="Brown" PM_x0023_="00124" /> <Row Manager="Cronkite" Client="Beta " Project_x0020_Name="Gannon" PM_x0023_="00129" /> <Row Manager="Clinton, Bill" Client="Beta " Project_x0020_Name="Harvard" PM_x0023_="00130" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Irving" PM_x0023_="00131" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Jakarta" PM_x0023_="00132" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Vassar" PM_x0023_="00135" /> <Row Manager="Jefferson" Client="Gamma " Project_x0020_Name="Stamford" PM_x0023_="00141" /> <Row Manager="Cronkite" Client="Gamma " Project_x0020_Name="Tufts" PM_x0023_="00142" /> <Row Manager="Frannklin" Client="Gamma " Project_x0020_Name="UCLA" PM_x0023_="00143" /> <Row Manager="Jefferson" Client="Gamma " Project_x0020_Name="Villanova" PM_x0023_="00144" /> <Row Manager="Carter" Client="Delta " Project_x0020_Name="Drexel" PM_x0023_="00150" /> <Row Manager="Clinton" Client="Delta " Project_x0020_Name="Iona" PM_x0023_="00151" /> <Row Manager="Frannklin" Client="Delta " Project_x0020_Name="Temple" PM_x0023_="00152" /> <Row Manager="Ford" Client="Epsilon " Project_x0020_Name="UNC" PM_x0023_="00157" /> <Row Manager="Clinton" Client="Epsilon " Project_x0020_Name="Berkley" PM_x0023_="00158" /> </Rows> </dsQueryResponse>

    Read the article

  • How to add some complex structure in multiple places in an XML file

    - by Guillaume
    I have an XML file which has many section like the one below: <Operations> <Action [some attributes ...]> [some complex content ...] </Action> <Action [some attributes ...]> [some complex content ...] </Action> </Operations> I have to add an <Action/> to every <Operations/>. It seems that an XSLT should be a good solution to this problem: <xsl:template match="Operations/Action[last()]"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> <Action>[some complex content ...]</Action> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> My problem is that the content of my <Action/> contains some xPath expressions. For example: <Action code="p_histo01"> <customScript languageCode="gel"> <gel:script xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sql="jelly:sql" xmlns:x="jelly:xml" xmlns:xog="http://www.niku.com/xog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <sql:param value="${gel_stepInstanceId}"/> </gel:script> </customScript> </Action> The ${gel_stepInstanceId} is interpreted by my XSLT but I would like it to be copied as-is. Is that possible? How?

    Read the article

  • XPATH: multiple negations in for-each

    - by Peter
    I have the following simplified XML: <?xml version="1.0" encoding="UTF-8" ?> <MATMAS05> <IDOC BEGIN="1"> <E1MARAM SEGMENT="1"> <MSGFN>005</MSGFN> <MATNR>000000000000401436</MATNR> <E1MARCM SEGMENT="1"> <MSGFN>005</MSGFN> <WERKS>A120</WERKS> <MMSTA>01</MMSTA> </E1MARCM> <E1MVKEM SEGMENT="1"> <VKORG>0120</VKORG> <VMSTA>04</VMSTA> </E1MVKEM> </E1MARAM> </IDOC> </MATMAS05> If <WERKS>=A120 and <MMSTA> is NOT '01' or '02' or '03' OR if <VKORG>=0120 and <VMSTA> is NOT '01' or '02' or '03' then the <MATNR> should be mapped to the target XML. I came up with the following XSLT: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output encoding="UTF-8" method="xml" indent="yes"/> <xsl:template match="/*"> <xsl:for-each select="IDOC[(E1MARAM/E1MVKEM[VKORG='0120'][not(VMSTA='01' or VMSTA='02' or VMSTA='03')]) or (E1MARAM/E1MARCM[WERKS = 'A120'][not(MMSTA='01' or MMSTA='02' or MMSTA='03')])]"> <Item> <ITEM_CODE> <xsl:value-of select="E1MARAM/MATNR"/> </ITEM_CODE> </Item> </xsl:for-each> </xsl:template> </xsl:stylesheet> But if I apply that XSLT I get the following unwanted output (because <MMSTA>='01'): <?xml version="1.0" encoding="UTF-8"?> <Item> <ITEM_CODE>000000000000401436</ITEM_CODE> </Item> How can I solve this? I have tried around with that XPATH expression but I can't get the wanted result. What am I doing wrong in my XPATH? Thank you for any ideas with this. Best regards, Peter

    Read the article

  • XSLT Built-in Template Rules for attributes

    - by Martin Smith
    I'm sure that this is an extremely basic question but here goes anyway! I have read that the built in template rule for text and attribute nodes in XSLT is <xsl:template match="text()|@*"> <xsl:value-of select="."/> </xsl:template> However for the source document <?xml version="1.0"?> <booker> <award> <author blah="test">Aravind Adiga</author> <title>The White Tiger</title> <year>2008</year> </award> </booker> And XSLT <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> </xsl:stylesheet> I get the following output applying the transform in Visual Studio. Can someone please explain why I don't see "test" in the output? Aravind Adiga The White Tiger 2008

    Read the article

  • Custom webserver caching

    - by Mark Kinsella
    I'm working with a custom webserver on an embedded system and having some problems correctly setting my HTTP Headers for caching. Our webserver is generating all dynamic content as XML and we're using semi-static XSL files to display it with some dynamic JSON requests thrown in for good measure along with semi-static images. I say "semi-static" because the problems occur when we need to do a firmware update which might change the XSL and image files. Here's what needs to be done: cache the XSL and image files and do not cache the XML and JSON responses. I have full control over the HTTP response and am currently: Using ETags with the XSL and image files, using the modified time and size to generate the ETag Setting Cache-Control: no-cache on the XML and JSON responses As I said, everything works dandy until a firmware update when the XSL and image files are sometimes cached. I've seen it work fine with the latest versions of Firefox and Safari but have had some problems with IE. I know one solution to this problem would be simply rename the XSL and image files after each version (eg. logo-v1.1.png, logo-v1.2.png) and set the Expires header to a date in the future but this would be difficult with the XSL files and I'd like to avoid this. Note: There is a clock on the unit but requires the user to set it and might not be 100% reliable which is what might be causing my caching issues when using ETags. What's the best practice that I should employ? I'd like to avoid as many webserver requests as possible but invalidating old XSL and image files after a software update is the #1 priority.

    Read the article

  • How can I write an XSLT that will recursively include other files?

    - by Eric
    Let's say I have a series of xml files in this format: A.xml: <page> <header>Page A</header> <content>blAh blAh blAh</content> </page> B.xml: <page also-include="A.xml"> <header>Page B</header> <content>Blah Blah Blah</content> </page> Using this XSLT: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/page"> <h1> <xsl:value-of select="header" /> </h1> <p> <xsl:value-of select="content" /> </p> </xsl:template> </xsl:stylesheet> I can turn A.xml into this: <h1> Page A </h1> <p> blAh blAh blAh </p> But how would I make it also turn B.xml into this? <h1> Page B </h1> <p> Blah Blah Blah </p> <p> blAh blAh blAh </p> I know that I need to use document(concat(@also-include,'.xml')) somewhere, but I'm not sure where. Oh, and the catch is, I need this to still work if B were to be included in a third file, C.xml. Any idea as to how to do this?

    Read the article

  • I can search users and site... but it will not search a blog that i use to view on my posted site fo

    - by Don
    I have always been able to search my blog where i post howtos for our company... However now i can only search for mysites or sites... when i click on a blog site that I created for Company Howtos i try to use the Search: This Site: "name of yhour site" click search i get the following No results matching your search were found. Check your spelling. Are the words in your query spelled correctly? Try using synonyms. Maybe what you're looking for uses slightly different words. Make your search more general. Try more general terms in place of specific ones. Try your search in a different scope. Different scopes can have different results. I have tried to do the following: 1) net stop osearch 2) net start osearch 3) iisreset /noforce ~ Please help! Don

    Read the article

  • Referencing a control inside a XSL Template from code behind ?

    - by Mina Samy
    Hi all I have a custom NewItem.aspx that I made by creating a new aspx from the exisiting one I wanted to put a control in a row inside the XSL Template like this <asp:DropDownList ID="ddlSectors" AutoPostBack="true" runat="server" __designer:bind="{ddwrt:DataBind('i',ddlSectors,'SelectedValue','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Sector')}"> </asp:DropDownList> <!--<SharePoint:FormField runat="server" id="ff7{$Pos}" ControlMode="New" FieldName="Sector" __designer:bind="{ddwrt:DataBind('i',concat('ff7',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Sector')}"/>--> <SharePoint:FieldDescription runat="server" id="ff7description{$Pos}" FieldName="Sector" ControlMode="New"/> Now I want to reference ddlSectors from my code library but it always throws an object reference not set to an instatnce of an object. I believe that this is becuase the control is inside the XSL template. so is there any workaround for this ? thanks

    Read the article

  • Own DataFormWebPart: Unable to display this Web Part.

    - by user307852
    Hi, What I want is to display a paginable list from my custom data source. All came from the fact that I needed some logical relationships between seach scopes and some dates. I considered ContentQueryWebpart, but CAML is too complicated as I have plenty of different conditions, CoreResults webpart is too limited as it uses KeyWordQuery so I inherited from DataFormWebPart to display my own custom search results from my own custom xml source. Thats the best way i am aware of... I knew I needed some configuration to write in my pageLayout like MyWebParts:MyCustomWebPart etc so I went to Designer, put DataFormWebPart on a page, linked it to list of pages, and set multiple item view and that gave me some configuration.. Firstly i checked if DataFormWebPart works when put on pageLayout and it sucessfully displayed my pages list in pages library. But that was not what I wanted, i needed to set my own XML data source... I then changed the configuration of WebPartPages:DataFormWebPart to match mine and detach from any listName or listId and I change the XSL tag to much simplier to display all results and now I am getting: Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator. and there is no way to know what is wrong:/ The webpart public class MyCustomWebPart : DataFormWebPart{ public override void DataBind() { ...... XmlDataSource source = new XmlDataSource(); source.Data = doc.InnerXml; this.DataSource=source; base.DataBind(); } } The doc XML: <dsQueryResponse><Rows><Row URL="http://myserver/sites/sc/myDoc.doc" TITLE="Specification.doc" AUTHOR="System.String[]" /></Rows></dsQueryResponse> The webpart is in PageLayout, inserted without webpartzone: <MyWebParts:MyCustomWebPart runat="server" Description="" ListDisplayName="" PartOrder="2" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="True" DataSourceID="" Title="" ViewFlag="0" NoDefaultStyle="TRUE" AllowConnect="True" FrameState="Normal" PageSize="10" PartImageLarge="" AsyncRefresh="True" ExportMode="All" Dir="Default" DetailLink="" ShowWithSampleData="False" FrameType="None" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" ManualRefresh="False" ChromeType="None" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" ViewContentTypeId="" InitialAsyncDataFetch="False" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" ListUrl="" ID="g_c2180fb9_c667_42f3_aab3_c3340cb0ac5a" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" IsIncludedFilter="" __MarkupType="vsattributemarkup" __WebPartId="{C2233FB9-C667-42F3-AAB3-C334223C5A}" __AllowXSLTEditing="true" WebPart="true" Height="" Width=""> <Xsl> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xmp> <xsl:copy-of select="*"/> </xmp> </xsl:template> </xsl:stylesheet> </Xsl> <DataSources> <SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="<View></View>" UpdateCommand="" InsertCommand="" DeleteCommand="" UseInternalName="True" ID="spdatasource3"> <SelectParameters> <asp:Parameter DefaultValue="0" Name="StartRowIndex"></asp:Parameter><asp:Parameter DefaultValue="0" Name="nextpagedata"> </asp:Parameter><asp:Parameter DefaultValue="10" Name="MaximumRows"></asp:Parameter> </SelectParameters> </SharePoint:SPDataSource> </DataSources> </MyWebParts:MyCustomWebPart>

    Read the article

  • C# and XSLT (using document() function in XSLT generates error)

    - by Simon
    I'd like to use embedded resources in my XSLT file, but while invoking 'document(...)' C# complains that "Error during loading document ..." I'd like to use defined resources in XSLT file and get them by this: "document('')//my:resources/"... How can i do that?? ex xsl: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="xslt-gruper-v1.2.xsl" exclude-result-prefixes="my"> tryb <xsl:variable name="res" select="document('')/*/my:resources/("/> How can i get access to such structure without exceptions in C#? I'll add that during static transform via ex. Opera everything works fine.

    Read the article

  • Ignoring 'A' and 'The' when sorting with XSLT

    - by ChrisV
    I would like to have a list sorted ignoring any initial definite/indefinite articles 'the' and 'a'. For instance: The Comedy of Errors Hamlet A Midsummer Night's Dream Twelfth Night The Winter's Tale I think perhaps in XSLT 2.0 this could be achieved along the lines of: <xsl:template match="/"> <xsl:for-each select="play"/> <xsl:sort select="if (starts-with(title, 'A ')) then substring(title, 2) else if (starts-with(title, 'The ')) then substring(title, 4) else title"/> <p><xsl:value-of select="title"/></p> </xsl:for-each> </xsl:template> However, I want to use in-browser processing, so have to use XSLT 1.0. Is there any way to achieve this in XLST 1.0?

    Read the article

  • How to pass a string containing both single and double quotes as a parameter to XSLT in PHP?

    - by Boaz
    Hi, I have a simple PHP-based XSLT trasform code that looks like that: $xsl = new XSLTProcessor(); $xsl->registerPHPFunctions(); $xsl->setParameter("","searchterms", $searchterms); $xsl->importStylesheet($xslDoc); echo $xsl->transformToXML($doc); The code passes the variable $searchterms, which contains a string, as a parameter to the XSLT style sheet which in turns uses it as a text: <title>search feed for <xsl:value-of select="$searchterms"/></title> This works fine until you try to pass a string with mixes in it, say: $searchterms = '"some"'." text's quotes are mixed." In that point the XSLT processor screams: Cannot create XPath expression (string contains both quote and double-quotes) What is the correct way to safely pass arbitrary strings as input to XSLT? Note that these strings will be used as a text value in the resulting XML and not as an XPATH paramater. Thanks, Boaz

    Read the article

  • Renaming nodes and values with xslt

    - by T.K.
    Hello world, I'm new to xslt, and have a task that I'm not really sure where to go with. I want to rename nodes, but maintain the format all node declarations. In the actual context I'll be applying this to, I'll be doing a series of renames like this, but for the sake of brevity, the sample I've written up only involves renaming one node. I am using XSL 1.0. Input: <variables> <var> <RENAME> a </RENAME> </var> <var RENAME='b'/> <var> <DO_NOT_TOUCH> c </DO_NOT_TOUCH> </var> <var DO_NOT_TOUCH='d'/> </variables> Desired Output: <variables> <var> <DONE> a </DONE> </var> <var DONE='b'/> <var> <DO_NOT_TOUCH> c </DO_NOT_TOUCH> </var> <var DO_NOT_TOUCH='d'/> </variables> My xslt: <xsl:template match="RENAME"> <RENAMED> <xsl:apply-templates select="@*|node()"/> </RENAMED> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> Current Output <variables> <var> <RENAMED> a </RENAMED> </var> <var RENAME="b"> </var> <var> <DO_NOT_TOUCH> c </DO_NOT_TOUCH> </var> <var DO_NOT_TOUCH="d"> </var> </variables>

    Read the article

  • How can I add multiple filters to a XSLT for-each statement?

    - by Huuuze
    I have the following XSLT node: <xsl:for-each select="Book[title != 'Moby Dick']"> .... </xsl:for-each> However, I'd like use multiple filters in the for-each. I've tried the following, but it doesn't seem to work: <!-- Attempt #1 --> <xsl:for-each select="Book[title != 'Moby Dick'] or Book[author != 'Rowling'] "> .... </xsl:for-each> <!-- Attempt #2 --> <xsl:for-each select="Book[title != 'Moby Dick' or author != 'Rowling']"> .... </xsl:for-each>

    Read the article

  • .NET Extension Objects with XSLT -- how to iterate over a collection?

    - by Pandincus
    Help me, Stackoverflow! I have a simple .NET 3.5 console app that reads some data and sends emails. I'm representing the email format in an XSLT stylesheet so that we can easily change the wording of the email without needing to recompile the app. We're using Extension Objects to pass data to the XSLT when we apply the transformation: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:EmailNotification="ext:EmailNotification"> -- this way, we can have statements like: <p> Dear <xsl:value-of select="EmailNotification:get_FullName()" />: </p> The above works fine. I pass the object via code like this (some irrelevant code omitted for brevity): // purely an example structure public struct EmailNotification { public string FullName { get; set; } } // Somewhere in some method ... var notification = new Notification("John Smith"); // ... XsltArgumentList xslArgs = new XsltArgumentList(); xslArgs.AddExtensionObject("ext:EmailNotification", notification); // ... // The part where it breaks! (This is where we do the transformation) xslt.Transform(fakeXMLDocument.CreateNavigator(), xslArgs, XmlWriter.Create(transformedXMLString)); So, all of the above code works. However, I wanted to get a little fancy (always my downfall) and pass a collection, so that I could do something like this: <p>The following accounts need to be verified:</p> <xsl:for-each select="EmailNotification:get_SomeCollection()"> <ul> <li> <xsl:value-of select="@SomeAttribute" /> </li> </ul> <xsl:for-each> When I pass the collection in the extension object and attempt to transform, I get the following error: "Extension function parameters or return values which have Clr type 'String[]' are not supported." or List, or IEnumerable, or whatever I try to pass in. So, my questions are: How can I pass in a collection to my XSLT? What do I put for the xsl:value-of select="" inside the xsl:for-each ? Is what I am trying to do impossible?

    Read the article

  • How can I strip line breaks from my XML with XSLT?

    - by Eric
    I have this XSLT: <xsl:strip-space elements="*" /> <xsl:template match="math"> <img class="math"> <xsl:attribute name="src">http://latex.codecogs.com/gif.latex?<xsl:value-of select="text()" /></xsl:attribute> </img> </xsl:template> Which is being applied to this XML (notice the line break): <math>\text{average} = \alpha \times \text{data} + (1-\alpha) \times \text{average}</math> Unfortunately, the transform creates this: <img class="math" src="http://latex.codecogs.com/gif.latex?\text{average} = \alpha \times \text{data} + (1-\alpha) \times&#10;&#9;&#9;&#9;&#9;&#9;\text{average}" /> Notice the whitespace character literals. Although it works, it's awfully messy. How can I prevent this?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >