Search Results

Search found 933 results on 38 pages for 'xslt'.

Page 18/38 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Add a Carriage Return to the Output of an XSL Transformation

    - by dsrekab
    I am trying to use XSLT to convert an XML document to a text file and the text of the document looks fine. However, I need to add a carriage return after the end of each line (NOT A CRLF) and I seem to be failing in every attempt. I have tried adding just a CR at the end of the line like this: <xsl:text>&#xD;</xsl:text> I have tried changing my media-type to string, I have tried to add the disable-output-escaping attribute to the text element, but it always adds a CRLF. This is on a Windows OS and I know that Windows uses CRLF for a new line, but I would have thought you could override that if you said to specifically use only the CR or the LF (e.g. VB.net's VBCR or VBLF). Does anyone know if it is possible to only output a CR with XSLT? Thanks in advance.

    Read the article

  • What processor is javax.xml.transform Using?

    - by Jeremy Witmer
    I've implented a simple webapp that transforms XML based on an XSTL stylesheet. It works fine on all the Windows servers I've deployed it on (to Tomcat), but on all Linux systems, I get a compile error on the XSLT. As best I can tell, it's because Java 1.6 isn't using the same processor behind javax.xml.transform. On the one Linux system, it's org.apache.xalan.xslt, version 2.4. What I can't figure out is how to generically figure out what any given system is using behind javax.xml.transform. Or, if anyone has any hints on what else I might do to figure out the problem, that'd be good, too.

    Read the article

  • Parsing HTML with XPath and PHP

    - by Peter
    Is there a way (using XPath and PHP) to do the following (WITHOUT external XSLT files)? Remove all tables and their contents Remove everything after the first h1 tag Keep only paragraphs (INCLUDING their inner HTML (links, lists, etc)) I received an XSLT answer here, but I'm looking for XPATH queries that don't require external files. Currently, I've got the HTML in question loaded into a SimpleXmlElement via: $doc = @DOMDocument::loadHTML($xml); $data = simplexml_import_dom($doc); Now I need help with: $data = $data->xpath('??????'); Been working with this one for several days to no avail. I really appreciate the help. Edit: I don't particularly care what's inside the paragraphs, as I can use strip_tags to eliminate what I don't want. All I need to do is to isolate the paragraphs from the rest of the source. I suppose a more specific, accurate requirement would be this: Return only paragraphs (and their html contents) that aren't contained in tables, and only before the first h1 tag

    Read the article

  • Display indented XML code within a HTML page

    - by Efrain
    I have a programmatically created HTML document on which I would like to show some XML-code, fully formatted with line breaks and tabulators. That is, it should look like if you drag an xml file without a xml-stylesheet directly onto your browser (most browsers do some kind of xml-rendering with some default style sheet). Now, I can of course escape all the characters (like <>, tab and newline) and do the indenting myself (using css styles, for example), but I was wondering whether I couldn't re-use some 'default' xml-stylesheet from somewhere. Preferrably also one that has some javascript node-folding, too. Do you know such a stylesheet/xslt? Or would you suggest another way to achieve this? I'm using C#. PS: I tried to use the XmlNotepad.DefaultSS.xslt from Microsoft's XmlNotepad, but I couldn't really get that working. :T

    Read the article

  • ASP.NET, XSLT, extracting values from a CDATA section

    - by H4mm3rHead
    Hi,i have a small problem i have xome xml with a cdata section. This CDATA section contains fragments of HTMl. I would like to extract some of the data inside this CDATA element. Right now i have a XSLT transformation that outputs the rest of the document as HTMl, but i need only a small part of the CDATA HTML, not the entire part - e.g. a my Title tag. How to do this?

    Read the article

  • Validate xsl fo in xslt styleesheet

    - by Biegal
    Hi, i have a little problem with validating xml, xslt in details. I have a xslt stylesheet that, transforms xml data source to xsl:fo document. Something like this: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns="http://www.w3.org/1999/xhtml"> <fo:layout-master-set> <fo:simple-page-master margin-top="25mm" margin-bottom="25mm" margin-left="25mm" margin-right="25mm" page-width="210mm" page-height="297mm" master-name="simplePageLayout"> <fo:region-body region-name="xsl-region-body" column-gap="0.25in" /> <fo:region-before region-name="xsl-region-before" display-align="after" extent="0.1mm" padding-top="0pt" padding-left="0.4in" padding-right="0.4in" padding-bottom="0pt" /> <fo:region-after region-name="xsl-region-after" display-align="before" extent="0.4in" padding-top="4pt" padding-left="0.4in" padding-right="0.4in" padding-bottom="0pt" /> </fo:simple-page-master> <fo:page-sequence-master master-name="default-sequence"> <fo:repeatable-page-master-reference master-reference="simplePageLayout" /> </fo:page-sequence-master> </fo:layout-master-set> <fo:page-sequence master-reference="default-sequence"> <fo:flow flow-name="xsl-region-body"> <fo:block font-family="Segoe UI" color="#000000" font-size="9pt" /> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> What I want to do, is to validate written xsl:fo elements, ignoring xsl tags. Is it posible? For now I use dtd validation (I have xsd schema too) for validating Fo, but it give me an error on each xsl tag. Summary. Is it posiible to validate only fo elements against the schema, ignoring xsl tags, and how should I do it? Maybe a code snnippet in C#, or a hint how to modify documents? Thanks in advance!

    Read the article

  • How to merge 2 XML streams in Java by XSLT

    - by user327933
    I'd like to merge 2 XML streams (strings) in Java, necessarily by XSLT (that I could change the transformation), but the problem is that the XMLs come as a string. There are many examples, but through the files. Can this be done without saving them in files? Thanks.

    Read the article

  • Delete / Remove node from XPathNodeIterator, given an XPath

    - by RymdPung
    First of all, if someone has a different, perhaps shorter (or better), solution to the problem, it's welcome as well. I'm trying to "simply" remove (almost) duplicate elements in XSLT. There's some (metadata) nodes i don't want to include when comparing, and i couldn't figure out how do do that in XSLT so thought i'd extend it with a function removing these nodes. Like so: <xsl:for-each select="abx:removeNodes(d/df600|d/df610|d/df611|d/df630|d/df650|d/df651|d/df655, '*[@key=&quot;i1&quot; or @key=&quot;i2&quot; or key=&quot;db&quot;]')"> <xsl:if test="not(node()=preceding-sibling::*)"> blah </xsl:if> </xsl:for-each> And the extension, which doesn't work so well... (C#) public XPathNodeIterator removeNodes(XPathNodeIterator p_NodeIterator, String removeXPath) { Logger Logger = new Logger("xslt"); Logger.Log("removeNodes(removeXPath={0}):", removeXPath); foreach (XPathNavigator CurrentNode in p_NodeIterator) { Logger.Log("removeNodes(): CurrentNode.OuterXml={0}.", CurrentNode.OuterXml); foreach (XPathNavigator CurrentSubNode in CurrentNode.Select(removeXPath)) { Logger.Log("removeNodes(): CurrentSubNode.OuterXml={0}.", CurrentSubNode.OuterXml); // How do i delete this node!? //CurrentSubNode.DeleteSelf(); } } return p_NodeIterator; } My initial approach using 'CurrentSubNode.DeleteSelf();' doesn't work because it gets confused and loses its position in the XPathNavigator, causing it to only delete the first item it finds using "removeXPath". Something like a DeleteAndMoveNext() would be nice but there seems to be no such method... Example data: <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> <df650 key="db">someDB</df650> <df650 key="id">b2</df650> <df650 key="dsname">someDS</df650> </df650> ..and then another identical node (if you ignore the meta fields; db,id,dsname). <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> <df650 key="db">someOtherDB</df650> <df650 key="id">b2</df650> <df650 key="dsname">someOtherDS</df650> </df650> The result should be... <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> </df650>

    Read the article

  • What are the drawbacks of sending XML to browsers and let them apply XSLT?

    - by MainMa
    Context Working as a freelance developer, I often made websites completely based on XSLT. In other words, on every request, an XML file is generated, containing everything we need to know about the page content: the name of the user currently logged in, the top menu entries, if this menu is dynamic/configurable, the text to display in a specific area of the page, etc. Then XSL process (caches, etc.) it to HTML/XHTML page to send to the browser. It has a good point to make it easier to create small-scale websites, especially with PHP. It is a sort of template engine, but which I prefer to other template engines because it's much more powerful than most of template engines, and because I know it better and like it. It is also possible, when need, to give an access to raw XML data on demand for an automated access, without the need to create separate APIs. Of course, it will fail completely on any medium-scale or large-scale website, since, even with good caching techniques, XSL still degrades overall website performance and requires more CPU serverside. Question Modern browsers have the ability to take an XML file and to transform it with an associated XSL file declared in XML like <?xml-stylesheet href="demo.xslt" type="text/xsl"?>. Firefox 3 can do it. Internet Explorer 8 can do it too. It means that it is possible to migrate XSL processing from the server to the client side for 50% of users (according on browser statistics on several websites where I may want to implement this). It means that those 50% of users will receive only the XML file at each request, thus reducing their and server's bandwidth (XML file being much shorter than its processed HTML analog), and reducing server's CPU usage. What are the drawbacks of this technique? I thought about several ones, but it doesn't apply in this situation: Difficult implementation and the need to choose, based on the browser request, when to send raw XML and when to transform it to HTML instead. Obviously, the system will not be much more difficult then the actual one. The only change to make is to add XSL file link to every XML, and to add a browser check. More IO and bandwidth usage, since the XSLT file will be downloaded by the browsers, instead of being cached by the server. I don't think it will be a problem, since XSLT file will be cached by the browsers (like images, or CSS, or JavaScript files are cached actually). Possibly some problems on client side, like maybe problems when saving a page in some browsers. Difficulty to debug code: it is impossible to obtain an HTML source the browser is actually using, since the only displayed source is the downloaded XML. On the other hand, I rarely go look at HTML code on client side, and in most cases, it is unusable directly (whitespace being removed).

    Read the article

  • Docbook+Ant: Could not find variable with the name of fop.extensions

    - by rfkrocktk
    After a lot of spent time trying to get my article to compile in Ant with Docbook, I can't seem to make FO compilation work. I'm using Xalan 2.7.0, and everything else (both single-page and chunked HTML) compiles perfectly. It's only when I try to compile to FO that I get this error: Fatal Error! org.apache.xml.utils.WrappedRuntimeException: Could not find variable with the name of fop.extensions Cause: org.apache.xml.utils.WrappedRuntimeException: Could not find variable with the name of fop.extensions This is pretty strange and I can't seem to resolve it. I even added a <param> value defining the variable it "can't find:" <xslt style="docbook-xsl/fo/fo.xsl" in="documents/book.xml" out="output.fo"> <classpath> <fileset dir="lib" includes="**/*"/> </classpath> <param name="fop.extensions" expression="1"/> </xslt> Is there anything I can do to resolve this issue? It's really weird if you ask me. (Again, using the same code as above, all of my other Docbook compilation works just fine)

    Read the article

  • How to add some complexe 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 attibutes ...]> [some complexe content ...] </Action> <Action [some attibutes ...]> [some complexe content ...] </Action> </Operations> I have to add an to every . 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 complexe 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 contains some xPath expressions. For exemple : <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 posible ? How ?

    Read the article

  • XML Pretty Printer Missing 2 Key Edge Cases

    - by viatropos
    Using this xslt file found on this blog to pretty print xml using Nokogiri, everything almost works, but to the point where I can't use it for HTML. First, if a node is empty, it turns it into a self closing node, so: <textarea></textarea> gets converted to <textarea/> But that messes up the html tree when rendered. Second, if the node just has text, the text isn't tabbed, and the closing node isn't tabbed, so: <li> <label>some text</label> </li> becomes: <li> <label>some text </label> </li> ...but it would ideally be: <li> <label> some text </label> </li> Does anyone who's pro at XSLT know a quick fix for this?

    Read the article

  • How can I search an XML file without a dynamic language?

    - by jeph perro
    Let me try to explain my situation: We are using a CMS which 'bakes' a website, and you publish it to a webserver. The published site contains only static HTML ( or XML ) pages ( generated from the content in the CMS database ). I imported an XML file with the names and phone numbers from the company phone directory. Using only XSLT, can I create a way to search that directory? For example, if my XML file, directory.xml looks like this: <directory> <person> <fname>Ryan</fname> <lname>Purple</lname> <phone>887 778 5544</phone> </person> <person> <fname>Tanya</fname> <lname>Orange</lname> <phone>887 998 5541</phone> </person> <directory> Can I create a way to search for a person with the last name starting with "Pur" ? Can I pass a parameter to the XSLT? Can I search the XML tree to match the string in the parameter?

    Read the article

  • Groupby distinct how can I do that?

    - by Christophe Debove
    Hello, <?xml version="1.0"?> <Products> <product> <productId >1</productId> <textdate>11/11/2011</textdate> <price>200</price> </product> <product> <productId >6</productId> <textdate>11/11/2011</textdate> <price>100</price> </product> <product> <productId >1</productId> <textdate>16/11/2011</textdate> <price>290</price> </product> </Products> I've this xml and I want an xslt transformation that regroup product something like this : { product 1 : 11/11/2011 - 200 16/11/2011 - 290 } { product 6 11/11/2011 - 100 } I work with xslt 1.0 Asp .net C# XslCompiledTransformation

    Read the article

  • BizTalk 2009 XSLT and Attribute Value Templates

    - by amok
    I'm trying to make use of attribute value type in a BizTalk XSL transformation to dynamically setting attribute or other element names. Read more here: http://www.w3.org/TR/xslt#dt-attribute-value-template The following code is an example of an XSL template to add an attribute optionally. <xsl:template name="AttributeOptional"> <xsl:param name="value"/> <xsl:param name="attr"/> <xsl:if test="$value != ''"> <xsl:attribute name="{$attr}"> <xsl:value-of select="$value"/> </xsl:attribute> </xsl:if> </xsl:template> Running this script in BizTalk results in "Exception from HRESULT: 0x80070002)" An alternative I was thinking of was to call a msxsl:script function to do the same but i cannot get a handle on the XSL output context from within the function. An ideas?

    Read the article

  • how to get doctype tag with url using xsl:output

    - by keshav.veerapaneni
    Hi, i have added the below xsl:output tag in xslt <xsl:output method="html" indent="yes" encoding="utf-8" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" </xsl:output as a result i get the below doctype tag in the html output- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" how can i mention the url in the doctype tag using xsl:output which would output a doctype tag that looks like below <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "_http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" Best Regards, Keshav

    Read the article

  • How to remove a node based on contents of a subnode and then convert to CSV with headers intact

    - by Morris Cox
    I'm downloading a 10MB zipped XML file with wget, unzipping it to 40MB, trying to weed out test and expired entries (if the text of a certain node is "This is a test opportunity. Please DO NOT apply!" or if is in the past), and then convert to CSV. However, I get this error: PHP Notice: Array to string conversion in /home/morris/projects/grantsgov/xml2csv.php on line 46 I get Array errors because some entries in the XML file have more than one occurrence of a node (different text contents). The test entries are still present. Contents of grantsgov.sh: #!/bin/bash wget --clobber "http://www.grants.gov/search/downloadXML.do;jsessionid=1n7GNpNF2tKZnRGLyQqf7Tl32hFJ1zndhfQpLrJJD11TTNzWMwDy!368676377?fname=GrantsDBExtract$(date +'%Y%m%d').zip" -O GrantsDBExtract$(date +"%Y%m%d").zip unzip GrantsDBExtract$(date +"%Y%m%d").zip php xml2csv.php zip GrantsDBExtracted$(date +"%Y%m%d").zip GrantsDBExtracted$(date +"%Y%m%d").csv Contents of xml2csv.php: <? $current_date = date("Ymd"); //$getfile=fopen("http://www.grants.gov/search/downloadXML.do;jsessionid=GqJNNmdLyJyMlsQqTzS2KdzgT5NMdhPp0QhG946JTmHzRltNTpMQ!368676377?fname=GrantsDBExtract$current_date.zip", "r"); $zip = zip_open("GrantsDBExtract$current_date.zip"); if(is_resource($zip)) { while ($zip_entry = zip_read($zip)) { $fp = fopen("./".zip_entry_name($zip_entry), "w"); if (zip_entry_open($zip, $zip_entry, "r")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); fwrite($fp,"$buf"); zip_entry_close($zip_entry); fclose($fp); } } zip_close($zip); } // For future potential use $xml = new DOMDocument('1.0', 'ascii'); $xpath = new DOMXpath($xml); $xslFile = "feddata.xsl"; $filexml="GrantsDBExtract$current_date.xml"; if (file_exists($filexml)) { $xml = simplexml_load_file($filexml); echo "Loaded $filexml\n"; $xslt = new XSLTProcessor(); $xsl = new DOMDocument(); //$XSL->load('feddata.xsl', LIBXML_NOCDATA); $xsl->load($xslFile, LIBXML_NOCDATA); $xslt->importStylesheet($xsl); $xslt->transformToXML($xml); $f = fopen("GrantsDBExtracted$current_date.csv", 'w'); // create the CSV header row on the first time here $first = FALSE; $fields = array(); foreach($record as $key => $value) { $fields[] = $key; } fwrite($f,implode(";",$fields)."\n"); foreach ($xml->FundingOppSynopsis as $fos) { fputcsv($f, get_object_vars($fos),',','"'); } } fclose($f); } else { exit('Failed to open file.'); } ?> Contents of feddata.xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="FundingOppSynopsis[AgencyMailingAddress = 'This is a test opportunity. Please DO NOT apply!']"> </xsl:template> </xsl:stylesheet><xsl:strip-space elements="*"/> Part of the XML file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Grants SYSTEM "http://www.grants.gov/search/dtd/XMLExtract.dtd"> <Grants> <FundingOppSynopsis> <PostDate>08312007</PostDate> <UserID>None</UserID> <Password>None</Password> <FundingInstrumentType>CA</FundingInstrumentType> <FundingActivityCategory>DPR</FundingActivityCategory> <OtherCategoryExplanation>This is a test opportunity. Please DO NOT apply!</OtherCategoryExplanation> <NumberOfAwards>5</NumberOfAwards> <EstimatedFunding>4</EstimatedFunding> <AwardCeiling>2</AwardCeiling> <AwardFloor>1</AwardFloor> <AgencyMailingAddress>This is a test opportunity. Please DO NOT apply!</AgencyMailingAddress> <FundingOppTitle>This is a test opportunity. Please DO NOT apply!</FundingOppTitle> <FundingOppNumber>IVV-08312007-RG-OPP5</FundingOppNumber> <ApplicationsDueDate>09102007</ApplicationsDueDate> <ApplicationsDueDateExplanation>This is a test opportunity. Please DO NOT apply!</ApplicationsDueDateExplanation> <ArchiveDate>10102007</ArchiveDate> <Location>None</Location> <Office>None</Office> <Agency>None</Agency> <FundingOppDescription>This is a test opportunity. Please DO NOT apply!</FundingOppDescription> <CFDANumber>000000</CFDANumber> <EligibilityCategory>21</EligibilityCategory> <AdditionalEligibilityInfo>This is a test opportunity. Please DO NOT apply!</AdditionalEligibilityInfo> <CostSharing>N</CostSharing> <ObtainFundingOppText FundingOppURL="">Not Available</ObtainFundingOppText> <AgencyContact AgencyEmailDescriptor="This is a test opportunity. Please DO NOT apply!" AgencyEmailAddress="This is a test opportunity. Please DO NOT apply!">This is a test opportunity. Please DO NOT apply!</AgencyContact> </FundingOppSynopsis> How can I fix the error and remove expired entries (based on ArchiveDate)? I suspect the second to last line in feddata.xsl needs to be fixed.

    Read the article

  • Can a Google Search Appliance / Mini output JSON/JSONP?

    - by Riley
    Using Google Mini for a website that needs output from the Google Mini in a JSON/JSONP format for front-end querying purposes. Google Mini does publish an XML feed that could potentially be used by a middle process to convert to JSON/JSONP. Can Google Search Appliance / Mini output to JSON/JSONP using a plug-in, modification to an XSLT template, or other unknown method?

    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

  • Merging XML records into one

    - by BhanuPratap Tarigopula
    I am new to XSLT. I have requirement of merging and adding. XML: <OrderDetails> <OrderDetail action="add"> <OrderedUnits>18</OrderedUnits> <Date>2013-09-30T00:00:00</Date> <LocationCode>3202</LocationCode> <PONumber>022548295755</PONumber> </OrderDetail> <OrderDetail action="add"> <OrderedUnits>12</OrderedUnits> <Date>2013-09-30T00:00:00</Date> <LocationCode>3202</LocationCode> <PONumber>022548295755</PONumber> </OrderDetail> <IOrderDetail action="add"> <OrderedUnits>18</OrderedUnits> <Date>2013-09-30T00:00:00</Date> <LocationCode>3202</LocationCode> <PONumber>022548295762</PONumber> </OrderDetail> <OrderDetails> If the LocationCode, Date, and PONumber fields match, I need to add the OrderedUnits and make it only one entry. Expected output XML: <OrderDetails> <OrderDetail action="add"> <OrderedUnits>30</OrderedUnits> <Date>2013-09-30T00:00:00</Date> <LocationCode>3202</LocationCode> <PONumber>022548295755</PONumber> </OrderDetail> <IOrderDetail action="add"> <OrderedUnits>18</OrderedUnits> <Date>2013-09-30T00:00:00</Date> <LocationCode>3202</LocationCode> <PONumber>022548295762</PONumber> </OrderDetail> <OrderDetails> How can I write this XSLT?

    Read the article

  • Using xml to feed a silverlight application

    - by Aidenn
    Hey! I am building a Silverlight application that should get it's elements from XML defined objects, but I am kinda stuck: how should I feed the Silverlight application with the data in the XML? What would be a good approach? Can this be done by transforming XML to XAML using XSLT? Any other suggestion?

    Read the article

  • Upload files to SSRS server

    - by xt_20
    I'm currently using the RS command to automate uploading an SSRS report. I have created a VB.NET program and it works well. Problem now is that I need to upload an XSLT file together with this report. Anyone knows any way of doing this, either using VB or even directly to the SSRS SQL Server db? Thanks

    Read the article

  • Comparing XML in SSRS

    - by silves89
    I'm new to SSRS. We'll have two slightly different chunks of XML in a single row of an SQL Server database table. In an SSRS report we'll want to show only the differences between the XML chunks. I don't know how to do this, but I suspect the XML Type in SQLServer 2005 might be useful, or XSLT transformations in SSRS. Could anyone point me in the right direction?

    Read the article

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