Jump to content

Search the Community

Showing results for tags 'xml'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

  1. hello dear all new to this forums and also new to php. so do not bear with me.well i am not too familiar with PHP. We just should run a few more xpath queries inside the loop for all the address keys and the website. we need to do this here <?php/** * OSM Overpass API with PHP SimpleXML / XPath * * PHP Version: 5.4 - Can be back-ported to 5.3 by using 5.3 Array-Syntax (not PHP 5.4's square brackets) *///// 1.) Query an OSM Overpass API Endpoint//$query = 'node ["amenity"~".*"] (38.415938460513274,16.06338500976562,39.52205163048525,17.51220703125);out;';$context = stream_context_create(['http' => [ 'method' => 'POST', 'header' => ['Content-Type: application/x-www-form-urlencoded'], 'content' => 'data=' . urlencode($query),]]);# please do not stress this service, this example is for demonstration purposes only.$endpoint = 'http://overpass-api.de/api/interpreter';libxml_set_streams_context($context);$start = microtime(true);$result = simplexml_load_file($endpoint);printf("Query returned %2$d node(s) and took %1$.5f seconds.nn", microtime(true) - $start, count($result->node));//// 2.) Work with the XML Result//# get all school nodes with xpath$xpath = '//node[tag[@k = "amenity" and @v = "school"]]';$schools = $result->xpath($xpath);printf("%d School(s) found:n", count($schools));foreach ($schools as $index => $school){ # Get the name of the school (if any), again with xpath list($name) = $school->xpath('tag[@k = "name"]/@v') + ['(unnamed)']; printf("#%02d: ID:%' -10s [%s,%s] %sn", $index, $school['id'], $school['lat'], $school['lon'], $name);}?> i just have had a quick view on the above mentioned site. i try to figure out how to do this - for any and all hints i am thankful The following code lists all schools and tries to obtain their names as well. I have not covered translations yet because my sample data didn't have those, but you can also look for all kind of names including translations and just prefer a specific one): //// 2.) Work with the XML Result//# get all school nodes with xpath$xpath = '//node[tag[@k = "amenity" and @v = "school"]]';$schools = $result->xpath($xpath);printf("%d School(s) found:n", count($schools));foreach ($schools as $index => $school){ # Get the name of the school (if any), again with xpath list($name) = $school->xpath('tag[@k = "name"]/@v') + ['(unnamed)']; printf("#%02d: ID:%' -10s [%s,%s] %sn", $index, $school['id'], $school['lat'], $school['lon'], $name);} The key point here are the xpath queries.In the above mentioend example two are used, the first xpath queriy is to get the nodes that have certain tags.I think this is the most interesting one for me: //node[tag[@k = "amenity" and @v = "school"]] This line says: Give us all node elements that have a tag element inside which has the k attribute value "amenity" and the v attribute value "school". This is the condition we have to filter out those nodes that are tagged with amenity school.Further on xpath is used again, now relative to those school nodes to see if there is a name and if so to fetch it: tag[@k = "name"]/@v' This line says: Relative to the current node, give me the v attribute from a tag element that as the k attribute value "name". As you can see, some parts are again similar to the line before. I think you can both adopt them to your needs.Because not all school nodes have a name, a default string is provided for display purposes by adding it to the (then empty) result array: list($name) = $school->xpath('tag[@k = "name"]/@v') + ['(unnamed)']; ^^^^^^^^^^^^^^^ Provide Default Value So here my results for that code-example: and now i try to figure out how i can enter more xpath queries at the above mentioned codeand get out even more important data - see here Key:contact - OpenStreetMap Wiki i will digg into all documents and come back later the weekend... and report all the findingswell - i think that i need to extend the xpath requests within the loop where xpath is used again,now relative to those school nodes to see if there is a name and if so to fetch it: tag[@k = "name"]/@v'tag[@k = " contact:website"]/@v'tag[@k = " contact:email"]/@v' What do you say...?many many thanks to you for all your help. You are very supportive. Keep up the superb work here....
  2. i hove store url of pic in xml i wan to get them and display in html i have been use Xpath language and XSLT but i don't display this pic. who can help me? thanks for help full follow is content of file xml(name hanghoa.xml) and file xslt(name hanghoa.xslt) <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xml" href="hanghoa.xslt"?> <KimLan> <HangHoa> <TenHang>Thuoc la Thang Long</TenHang> <HinhAnh><img src="pics/thuoclathanglong.jpg"/></HinhAnh>(i try to replace that)<HinhAnh>"pics/thuoclathanglong.jpg"</HinhAnh> <Gia>8.000 VND</Gia> <GhiChu>Một cây: 100.000 VND</GhiChu> </HangHoa> </KimLan> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:template match="/"> <html> <head> <title>Tap Hoa Kim Lan</title> <link href="css/common.css" rel="stylesheet" type="text/css"/> </head> <body> <div class="header"></div> <div class="content"> <xsl:for-each select="/KimLan/HangHoa"> <xsl:variable name="url" select="HinhAnh"/> <div class="hanghoa"> <xsl:value-of select="$url"/> ( i try to replace that with)<img src="<xsl:value-of select="$url"/>"/> <div class="detail"> <p><xsl:value-of select="TenHang"/></p> <p><xsl:value-of select="Gia"/></p> <p><xsl:value-of select="GhiChu"/></p> </div> </div> </xsl:for-each> <div class="clr"></div> </div> <div class="footer"> <p> Website is create by Nguyen Van Tuyen </p> </div> </body> </html> </xsl:template> </xsl:stylesheet>
  3. Hello everyone, I have my wsdl file and a php page with Soap and I would use the XML files, but I'm a bit lost with namespace and schemaLocation when I call the xml file it appears empty, i just take the some line to show the namespace and Schemaslocation. wsdl: <?xml version="1.0" encoding="UTF-8"?><definitions xmlns:typens="urn:b2bHotelSOAP" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="b2bHotelSOAP" targetNamespace="urn:b2bHotelSOAP"> <types> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:b2bHotelSOAP"> <!--<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>--> <complexType name="roomArray"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:paxesArray[]"/> </restriction> </complexContent> </complexType> <complexType name="paxesArray"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:pax[]"/> </restriction> </complexContent> XML : <?xml version="1.0" encoding="UTF-8" ?> - <XMLResponse schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:b2bHotelSOAP" > <ResponseType>HotelListResponse</ResponseType> - <RequestInfo> <AffiliateCode>XX0000</AffiliateCode> <AffRequestId>XXX</AffRequestId> <AffRequestTime>yyyy-mm-ddThh:mm:ss</AffRequestTime> </RequestInfo> <TotalNumber>XXXXX</TotalNumber> - <Hotels> Thank you !
  4. hi friend i am used the java script to display the currency of Iraqi dinars from this xml file http://www.xe.com/datafeed/samples/sample-xml-usd.xml and i used this code <script>if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.open("GET","http://www.xe.com/datafeed/samples/sample-xml-usd.xml",false);xmlhttp.send();xmlDoc=xmlhttp.responseXML; currency=xmlDoc.getElementsByTagName("crate")[65].childNodes[0].nodeValue;document.write(currency);</script> but that is not work and i don't know why? please tell me what is my mistakes ... help me
  5. I want to change my xml file into xsl so that it can fit into my chart, I am trying to put it into ascending form… This is my .xml<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="banks.xsl"?> <chart caption='Banks' xAxisName='Bank Types' yAxisName='Amount' numberPrefix='$' showValues='0'> <set label='UOB' value='420000' /> <set label='UOB' value='910000' /> <set label='DBS' value='720000' /> <set label='OCBC' value='550000' /> <set label='UOB' value='810000' /> <set label='DBS' value='510000' /> <set label='OCBC' value='680000' /> <set label='UOB' value='620000' /> <set label='DBS' value='610000' /> <set label='OCBC' value='490000' /> <set label='OCBC' value='530000' /> <set label='DBS' value='330000' /> <styles> <definition> <style name='CanvasAnim' type='animation' param='_xScale' start= '0' duration='1' /> </definition> <application> <apply toObject='Canvas' styles='CanvasAnim' /> </application> </styles> </chart> And this is my .xsl file <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="chart"> <xsl:apply-templates select="label"> <xsl:sort order="ascending" /> </xsl:apply-templates> </xsl:template> </xsl:stylesheet> I had another try: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output indent="yes"/><xsl:strip-space elements="*"/><xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"><xsl:sort select="@value"/></xsl:apply-templates></xsl:copy></xsl:template></xsl:stylesheet> But both cannot work... please help me... Thank you!!!
  6. Hello everyoneI need to transform an XML file to Excel. The style sheet (XSL) should be applied on import. There appears to be an acknowledged bug:http://support.microsoft.com/kb/307230/en-USThe workaroudn involves converting XML to HTML first, then to Excel-format. The script is in VBA:Sub Macro3()'Load the XML and the XSL (the stylesheet).Dim oXML As Object, oXSL As ObjectSet oXML = CreateObject("MSXML.DOMDocument")Set oXSL = CreateObject("MSXML.DOMDocument")oXML.Load "c:customers.xml"oXSL.Load "c:customers.xsl"'Transform the XML using the stylesheet.Dim sHTML As StringsHTML = oXML.transformNode(oXSL)'Save the results to an HTML file.Open "c:customers.htm" For Output As #1 '!fails herePrint #1, sHTMLClose #1'Automate Excel to open the HTML file.Dim oApp As Excel.ApplicationSet oApp = CreateObject("excel.application")oApp.Visible = TrueoApp.Workbooks.Open "c:customers.htm"End SubConverted to VBScript the code fails at the line indicated above, presumably because VBScript does not know the method. I'm not proficient in VBScript so any help is appreciated
  7. <xsl:variable name="A" select="count($TEST)"/><cell dim="A 1"> %%% here i want to have the value of A <xsl:for-each select="$TEST"> <struct dim="1 1"> <rec>...........</struct></cell> Hi, I want define a cell/struct field and the Dimension of the cell should be flexible, according to the Input.here is a what i want to have:
  8. What I'm trying to do is use an xml DOM created in php to display on my webpage using an ajax call. I'm pretty sure this is a JavaScript problem, but it's possible there may be an issue with my php code. Part of the php code is below if needed. The reason I believe the php code is fine, is because if I go directly to the page and uncomment the saveHTML() line, it displays fine. The first code below is my ajax call. I think the call fails, because what I get is the alert error message in my code (An error has occured). I'm not sure what the issue is. Thanks for any suggestions. request = $.ajax({ url: "results.php", type: "POST", dataType: "xml" }).done(function (data){ $(data).find("stat").each(function(){ $("result").append($(this).find("fName").text() + "<br>"); }); }).fail(function (){ alert("An error has occured."); }); $result=mysqli_query($con,$cmd);$doc = new DOMDocument("1.0", "utf-8"); $root = $doc->createElement('stats'); $doc->appendChild($root); while($row=mysqli_fetch_array($result)){ // Creates the main xml element stat $element = $doc->createElement("stat"); // Declares variables from SQL table to be used for sub-elements $fName = $row['fName']; $lName = $row['lName']; $position = $row['position']; $pYard = $row['pYard']; // Create sub-elements $pfName = $doc->createElement("fName", $fName); $plName = $doc->createElement("lName", $lName); $pPosition = $doc->createElement("position", $position); $pPYard = $doc->createElement("pYard", $pYard); // Add sub-elements to main element stat $element->appendChild($pfName); $element->appendChild($plName); $element->appendChild($pPosition); $element->appendChild($pPYard); // Add main element to root $root->appendChild($element); } //echo $doc->saveHTML(); echo $doc;
  9. hello to all, I'm newbie with XML, XSL and I've been trying and I'm only getting the first 2 rows(headers) of the output desired so far. May somebody help me in how to get output of table below with an xsl stylesheet using the XML input below. The XML input is: <?xml version="1.0" encoding="UTF-8"?><TUPH><KIND><ABx>Event 1</ABx><RN><MO><CDy>11</CDy><CDy>5</CDy> </MO> <MO><MJp>6</MJp><MJp>7</MJp><MJp>9</MJp> </MO> </RN><JN><MO><CDy>8</CDy> </MO> <MO><MJp>1</MJp><MJp>3</MJp> </MO> </JN> </KIND><KIND> <ABx>Event 2</ABx><RN><MO><CDy>3</CDy></MO> <MO><MJp>5</MJp></MO> </RN><JN><MO><CDy>6</CDy></MO> <MO><MJp>2</MJp></MO> </JN></KIND> </TUPH> ​The XSL I have so far is: <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="html"/> <xsl:template match="/"><html><table border="1"><tr><td></td><td>RN</td><td></td><td>JN</td><td></td> </tr><tr><td>ABx</td><td>CDy</td><td>MJp</td><td>CDy</td><td>MJp</td> </tr><xsl:apply-templates select="KIND"/> </table> </html></xsl:template> <xsl:template match="KIND/ABx"><td> <xsl:apply-templates select="ABx"/></td></xsl:template> </xsl:stylesheet> The output I'm looking for is: <html> <table border="1"> <tr> <td></td> <td>RN</td> <td></td> <td>JN</td> <td></td> </tr> <tr> <td>ABx</td> <td>CDy</td> <td>MJp</td> <td>CDy</td> <td>MJp</td> </tr> <tr> <td>Event 1</td> <td>11</td> <td>6</td> <td>8</td> <td>1</td> </tr> <tr> <td></td> <td>5</td> <td>7</td> <td></td> <td>3</td> </tr> <tr> <td></td> <td></td> <td>9</td> <td></td> <td></td> </tr> <tr> <td>Event 2</td> <td>3</td> <td>5</td> <td>6</td> <td>2</td> </tr> </table> </html> Thanks in advance for any help.
  10. Hello all, first time poster on the forum and I can get some insight on how to solve a problem I am having. I hope its rewarding for you as well. A little background, I am using an xml file that is exported from Autodesk Civil 3D that list Pay Items, Quantities, and Units for Road Construction estimates. My goal is to harness this xml file to include unit prices and then create a total cost per pay item. You will see there is a field for <estimatedUnitPrice> and I would but in a price there for each item. For now I can not even use the xsl file and the html file to get a table to generate that will list each pay item. Below is the code, and I have attached a picture of the results of running this code via Visual Web Developer Express, as may see it will not list the pay item <gml:description> which I expect. XML file Named "Summary (XML)" This file comes directly from Autodesk Civil 3D, I only have one pay item listed here for brevity sake, normally there would be many <item> sections. <?xml version="1.0" encoding="UTF-8"?><DesignProject xsi:schemaLocation="http://www.transxml.net/schema/dp/0.3 DP-GML20060123pxs.xsd" gml:id="ID001" xmlns="http://www.transxml.net/schema/dp/0.3" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:txl="http://www.transxml.net/schema/txl/0.3" xmlns:rpi="http://www.transxml.net/schema/rpi/0.3" xmlns:lr="http://www.transxml.net/schema/lr/0.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <gml:name>design project</gml:name> <gml:description></gml:description> <projectID>ID001</projectID> <unitSystem>english</unitSystem> <group> <DesignProjectPayItemGroup gml:id="dppig1"> <gml:description></gml:description> <designProjectPayItemGroupID>dppig1</designProjectPayItemGroupID> <item> <DesignProjectPayItem gml:id="id"> <sequenceOrder>0</sequenceOrder> <estimatedUnitPrice>0</estimatedUnitPrice> <estimatedQuantity>4558.445</estimatedQuantity> <referencePayItem> <ReferencePayItem gml:id="60201-0600" xmlns="http://www.transxml.net/schema/ref/0.3"> <gml:description>18-INCH PIPE CULVERT</gml:description> <referencePayItemID>60201-0600</referencePayItemID> <specBookVersion></specBookVersion> <lumpSum>false</lumpSum> <supplementalDescriptionRequired>false</supplementalDescriptionRequired> <unit> <txl:UnitOfMeasure> <txl:unitOfMeasureID>LNFT</txl:unitOfMeasureID> <txl:unitSystem></txl:unitSystem> </txl:UnitOfMeasure> </unit> </ReferencePayItem> </referencePayItem> <referenceInformation xmlns="Civil3D.QTO.Computation"> <unitType>linear</unitType> <listSeparator>,</listSeparator> </referenceInformation> </DesignProjectPayItem> </item> </DesignProjectPayItemGroup> </group></DesignProject> XSL File Named "Detailed" I got thie file from an example for W3Schools Tutorials. I changed only what was in bold, and deleted a second column that was in the org example. <?xml version="1.0" encoding="iso-8859-1"?><!-- Edited by XMLSpy® --><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Description</th> </tr> <xsl:for-each select="DesignProject/group/DesignProjectPayItemGroup/item/DesignProjectPayItem/ReferencePayItem"> <tr> <td> <xsl:value-of select="gml:description" /> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template></xsl:stylesheet> HTM file named "Detailed" Again this file source code came from a tutorial and I changed the file names that are in bold below. <html><head><script> function loadXMLDoc(filename) { if (window.ActiveXObject) { xhttp = new ActiveXObject("Msxml2.XMLHTTP"); } else { xhttp = new XMLHttpRequest(); } xhttp.open("GET", filename, false); try { xhttp.responseType = "msxml-document" } catch (err) { } // Helping IE11 xhttp.send(""); return xhttp.responseXML; cription } function displayResult() { xml = loadXMLDoc("Summary (XML).xml"); xsl = loadXMLDoc("Detailed.xsl"); // code for IE if (window.ActiveXObject || xhttp.responseType == "msxml-document") { ex = xml.transformNode(xsl); document.getElementById("example").innerHTML = ex; } // code for Chrome, Firefox, Opera, etc. else if (document.implementation && document.implementation.createDocument) { xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); resultDocument = xsltProcessor.transformToFragment(xml, document); document.getElementById("example").appendChild(resultDocument); } }</script></head><body onload="displayResult()"><div id="example" /></body></html>
  11. studiosx

    foreach() error

    I want to export videos, thumbs, duration, etc from my website into a xml format. I got this error: Invalid argument supplied for foreach() $output .= ' <clips>';if (!is_array( $vids )) { $vids = array( ); foreach ($imgs as $img) { $img = explode( '.', $img ); $vids[] = '0' . $img[0] . '.flv'; }}@sort( $vids );@sort( $imgs );$i = 38;foreach ($vids as $v) { $output .= ' <clip>'; $output .= ' <duration>' . $duration . '</duration>'; $output .= ' <width>' . $width . '</width>'; $output .= ' <height>' . $height . '</height>'; $output .= ' <flv>' . $v . '</flv>'; $output .= ' <screens> <screen>' . trim( $imgs[$i] ) . '</screen> </screens>'; $output .= ' </clip>'; ++$i;}$output .= ' </clips>'; Thank you!
  12. hi i'm trying to fetch result from other website i'm able to fetch from other website but i'm willing to give a option for user to have pdf download link . how can i convert html data to pdf link while it fetch result from other website itself ex: i'm trying to fetch result from one of the univ website where results will be announced.i'm trying to fetch result sheet from that website http://www.result.vtu.ac.in/vitavi.php but i'm willing to give download link to user but i'm unable to do it plz help out
  13. Hi All, We are designing amobile application based on Oracle Siebel. We are stuck on mobile build. We are facing the problem on navigating from first html page to another.Actually what is happening in Vanilla Object Manager 'Siebel Self Service Wireless (ENU)' is after login page only one html page is defined which is Main page/Dashboard page. But in our mobile build wireframe, it has two html pages after login. But in tools at application level, we define only 'acknowledgement page' which is Main Page and its corresponding .swt and .xsl file.So our problem is to figure out how it will navigate from main page to next html page and to subsequent pages after that. Any help in this matter would be highly appreciated.
  14. I just need help please with linking to my facebook correctly. Please be nice , and I'm sure this is pretty easy for everyone else, but I am having trouble with it. I have attached the file and image, if anyone can be good enough to help me out. My email is cafedesignercafe@gmail.com My Skype is evolution2design My facebook is facebook.com/rcmp004 Thank you so much ! config.xml
  15. I have been trying to find a solution to my problem is the last 10 days, and I found nothing. So, I am trying to restrict the Authentication Context XML Schema Definition of SAML 2.0. The XSD document is accessible at http://docs.oasis-open.org/security/saml/v2.0/saml-schema-authn-context-types-2.0.xsd. The part that I am trying to restrict is the one related to this part of the XSD document: <xs:complexType name="PasswordType"> <xs:sequence> <xs:element ref="Length" minOccurs="0"/> <xs:element ref="Alphabet" minOccurs="0"/> <xs:element ref="Generation" minOccurs="0"/> <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="ExternalVerification" type="xs:anyURI" use="optional"/></xs:complexType><xs:element name="RestrictedPassword" type="RestrictedPasswordType"/><xs:complexType name="RestrictedPasswordType"> <xs:complexContent> <xs:restriction base="PasswordType"> <xs:sequence> <xs:element name="Length" type="RestrictedLengthType" minOccurs="1"/> <xs:element ref="Generation" minOccurs="0"/> <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="ExternalVerification" type="xs:anyURI" use="optional"/> </xs:restriction> </xs:complexContent></xs:complexType> Well, I do not know how to restrict the RestrictedPassword complex Type. Below is my XSD, that tries to restrict the original XSD document. <?xml version="1.0" encoding="UTF-8"?><xs:schema version="2.0" targetNamespace="urn:m:SAML:2.0:ac:classes:K" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:m:SAML:2.0:ac:classes:K" finalDefault="extension" blockDefault="substitution"> <xs:redefine schemaLocation="http://docs.oasis-open.org/security/saml/v2.0/saml-schema-authn-context-types-2.0.xsd"> <xs:complexType name="RestrictedPasswordType"> <xs:complexContent> <xs:restriction base="RestrictedPasswordType"> <xs:sequence> <xs:element ref="Length" minOccurs="0"/> <xs:element ref="Generation"/> <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="ExternalVerification" type="xs:anyURI" use="optional"/> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:redefine> </xs:schema> When I try to validate this XSD in this tool http://www.utilities-online.info/xsdvalidation/#.UwJAzK69h31 it returns me an error, that I do not know how to fix. Any help is welcome. Thanks! Domenech, Marlon
  16. Some quick context to what I'm doing. I'm utilizing a test automation tool called SOASTA. What this software allows me to do is record performed actions on a mobile device and then play back those same actions at anytime. When recording actions, SOASTA will assign the action performed a random locator value. This value can be modified to equal a specific XPATH value. On the mobile application I'm recording action on, I have 3 files stored called TEST SIGN.doc, TEST SIGN.docx, and TEST SIGN.pdf, separated by the node <RelativeLayout> in the XML code shown below. Each of these files have a button on them that when tapped, opens a window to perform certain actions. In the XML hierachy, these three buttons are all assigned the same value of, <DontPressWithParentImageView touchTestId="img_item_action"/>. My question is, is there an XPATH that will allow me to distinguish between the 3 buttons even though the buttons have the same values? THANK YOU IN ADVANCE!! <ListView touchTestId="16908298"> <RelativeLayout> <ImageView touchTestId="img_icon"/> <TextView text="TEST SIGN.doc" touchTestId="txt_title"/> <TextView text="21.5 KB, modified Jan 20, 2014 03:36 PM" touchTestId="txt_info"/> <CheckBox text="" touchTestId="checkbox"/> <View touchTestId="divider"/> <DontPressWithParentImageView touchTestId="img_item_action"/> </RelativeLayout> <RelativeLayout> <ImageView touchTestId="img_icon"/> <TextView text="TEST SIGN.docx" touchTestId="txt_title"/> <TextView text="12.6 KB, modified Jan 20, 2014 03:36 PM" touchTestId="txt_info"/> <CheckBox text="" touchTestId="checkbox"/> <View touchTestId="divider"/> <DontPressWithParentImageView touchTestId="img_item_action"/> </RelativeLayout> <RelativeLayout> <ImageView touchTestId="img_icon"/> <TextView text="TEST SIGN.pdf" touchTestId="txt_title"/> <TextView text="12.7 KB, modified Jan 20, 2014 03:36 PM" touchTestId="txt_info"/> <CheckBox text="" touchTestId="checkbox"/> <View touchTestId="divider"/> <DontPressWithParentImageView touchTestId="img_item_action"/> </RelativeLayout></ListView>
  17. Hi, I need to know which are the correct answers in the following MCQ type XML code. 1. Example 1 - Only one answer is correct out of the following. <?xml version="1.0" encoding="UTF-8" ?> - <pages sgxmlv="1.2"> - <page> <template>q1.swf</template> <title /> - <pics> <pic /> <pic /> <pic /> <pic /> <pic /> </pics> - <sounds> <snd /> <snd /> <snd /> <snd /> <snd /> </sounds> - <texts> <txt a="X" c="X" e="-3" pt="1" s="2">How do Club Associations secure their economic position?</txt> <txt crct="83" c="X" s="2">From a system of mutual support.</txt> <txt crct="91" c="X" s="2">From levying high premiums on owners.</txt> <txt crct="48" c="X" s="2">By pursuing strong counter claims through the courts.</txt> <txt crct="99" c="X" s="2">By minimizing insurance settlements through clever interpretation of insurance rules.</txt> </texts> - <soundTexts> <sndTxt /> <sndTxt /> <sndTxt /> <sndTxt /> <sndTxt /> </soundTexts> </page> <subpages /> </pages> 2. Example 2 - More than one answer is correct out of the following. <?xml version="1.0" encoding="UTF-8" ?> - <pages sgxmlv="1.2"> - <page> <template>q1.swf</template> <title /> - <pics> <pic /> <pic /> <pic /> <pic /> <pic /> <pic /> <pic /> </pics> - <sounds> <snd /> <snd /> <snd /> <snd /> <snd /> <snd /> <snd /> </sounds> - <texts> <txt a="X" c="X" e="-3" pt="1" s="2">In respect of goods which are intended to be, or being, or which have been carried in the transport, which of the following claims are covered by Club insurance? (Select all appropriate answers)</txt> <txt crct="83" c="X" s="2">Loss.</txt> <txt crct="84" c="X" s="2">Short delivery.</txt> <txt crct="5" c="X" s="2">Theft.</txt> <txt crct="66" c="X" s="2">Damage.</txt> <txt crct="80" c="X" s="2">Loss of commercial value during transit.</txt> <txt crct="101" c="X" s="2">Damage whilst in independent storage.</txt> </texts> - <soundTexts> <sndTxt /> <sndTxt /> <sndTxt /> <sndTxt /> <sndTxt /> <sndTxt /> <sndTxt /> </soundTexts> </page> <subpages /> </pages> These are computer based training modules. The assessment is coded in XML and i need to know the correct answers in order to pass. How do i interpret the above to finding the right answers. XML Experts you help is highly appreciated.
  18. Alright. Forgive me if this is a really dumb question, but I think I'm missing some crucial information here. Is there any good, simple way, to embed a little XML data in an HTML document? Not a whole sheet, just one node. For instance, say I've made an XML document describing a book. Is there a simple way to embed the info held in the <AUTHOR> tag in an HTML document as plain text? Example: Author: <embedded XML bit goes here> Thanks, and sorry if I'm really missing something important here.
  19. How can I get the value of an attribute and use it in a conditional statement. For example I have <O Option="a" LineNr="1"> and this is element is a child under another parent element that gets grouped with other elements. So the condition I want is: if [value-of Option is null] then [do nothing] else-if [check if the value of the attribute of the element under the next parent element with the same value is empty]. And if there are for example 3 parent elements that contain this element with the Option attribute and if all of the attributes are NOT empty - then group them. I have the grouping done, but it is not connected with this attribute that I want to use now. So I need just the formulation of the conditional statements. edit: giving input and output desired examples Input example 1: <Area><Type>A</Type><Street><Position>5</Position><House><L Option="" LineNr="1">--> some elements</L></House></Street><Street><Position>5</Position><Block><O Option="" LineNr="1">--> some elements</O></Block></Street><Street><Position>6</Position><House><L Option="o" LineNr="1">--> some elements</L></House></Street><Street><Position>6</Position><Block><O Option="" LineNr="1">--> some elements</O></Block></Street></Area> And desired output: <Area><Type>A</Type><Street><Position>5</Position><House><L Option="" LineNr="1">--> some elements</L></House><Block><O Option="" LineNr="1">--> some elements</O></Block></Street><Street><Position>6</Position><House><L Option="o" LineNr="1">--> some elements</L></House><Block><O Option="" LineNr="1">--> some elements</O></Block></Street></Area> But if in the same position number, all the occurrences have a value in the Option attribute of L or O, then I want them arranged under the other occurrence of a position number. Like that: Input example 2: <Area><Type>A</Type><Street><Position>5</Position><House><L Option="" LineNr="1">--> some elements</L></House></Street><Street><Position>5</Position><Block><O Option="" LineNr="1">--> some elements</O></Block></Street><Street><Position>6</Position><House><L Option="o" LineNr="1">--> some elements</L></House></Street><Street><Position>6</Position><Block><O Option="a" LineNr="1">--> some elements</O></Block></Street></Area> Then the output will be: <Area><Type>A</Type><Street><Position>5</Position><House><L Option="" LineNr="1">--> some elements</L></House><Block><O Option="" LineNr="1">--> some elements</O></Block><House><L Option="o" LineNr="1">--> some elements</L></House><Block><O Option="a" LineNr="1">--> some elements</O></Block></Street></Area> as now position 6 is gone and its child elements are grouped under the upper occurrence position (which is 5 in this case in the same Type) as all of the attributes Option in the L or O elements had value (which can be either "a" or "o", if that is relevant). And this is the XSLT which I am using now. It only groups the elements of the different occurrences of the same position numbers under one number: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:strip-space elements="*" /><xsl:output method="xml" indent="yes" /><xsl:key name="streetByPosition" match="Street" use="concat(../Type, '|', Position)" /><xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()" /></xsl:copy></xsl:template><!-- for the first Street in each Position --><xsl:template match="Street[generate-id() =generate-id(key('streetByPosition', concat(../Type, '|', Position))[1])]"><Street><!-- copy in the Position element once only --><xsl:apply-templates select="Position" /><!-- copy in all sub-elements except Position from all matching Streets--><xsl:apply-templates select="key('streetByPosition', concat(../Type, '|', Position))/*[not(self::Position)]" /></Street></xsl:template><!-- ignore all other Street elements --><xsl:template match="Street" /></xsl:stylesheet> I really, really need solution for that and I have no clue how to do it, especially the checks.
  20. hi all, i m very new to xslt. i need a help.i want add a root tag in my xml using xslt where xml file returning more than one rows. my xslt is demo.xsl <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="/*:ExportXML"> <sources> <xsl:for-each-group select="*:record" group-by="*:field[@name=ContestNumber]"> <sourcetype> <sourcelist> </sourcelist> </sourcetype> </xsl:for-each-group> </sources> </xsl:template> <xsl:template match="*:field"> <xsl:element name="{lower-case(@name)}"> <xsl:apply-templates/> </xsl:element> </xsl:template> <xsl:template match="*:record"> <JobPositionPostings> <JobPositionPosting> <xsl:apply-templates select="*:field[starts-with(@name,'ContestNumber')]"/> <JobDisplayOptions> <xsl:apply-templates select="*:field[starts-with(@name,'ManagerRequisitionTitle')]"/> </JobDisplayOptions> </JobPositionPosting> </JobPositionPostings> </xsl:template> <xsl:template match="*:field[@name=TypeName]"/> <xsl:template match="*:field[@name=TypeName]" mode="title"> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> my output is cming like this requisition.xml <?xml version="1.0" encoding="UTF-8"?><JobPositionPostings> <JobPositionPosting> <jobpositionpostingid>1300000F</jobpositionpostingid> <HiringOrg> <Industry> <summarytext>Project Manager</summarytext> </Industry> <Contact> <PersonName/> </Contact> </HiringOrg> <JobDisplayOptions/> <JobPositionInformation> <JobClassifications> <PrimaryJobCategory/> </JobClassifications> <JobPositionDescription/> <JobPositionLocation/> <CompensationDescription> <Pay/> </CompensationDescription> <JobPositionRequirements> <JobExperience/> <JobQualifications/> </JobPositionRequirements> </JobPositionInformation> <HowToApply> <ApplicationMethods> <ByEmail/> <ByWeb/> </ApplicationMethods> </HowToApply> </JobPositionPosting></JobPositionPostings><JobPositionPostings> <JobPositionPosting> <jobpositionpostingid>1300000H</jobpositionpostingid> <HiringOrg> <Industry> <summarytext>Project Manager</summarytext> </Industry> <Contact> <PersonName/> </Contact> </HiringOrg> <JobDisplayOptions/> <JobPositionInformation> <JobClassifications> <PrimaryJobCategory/> </JobClassifications> <JobPositionDescription/> <JobPositionLocation/> <CompensationDescription> <Pay/> </CompensationDescription> <JobPositionRequirements> <JobExperience/> <JobQualifications/> </JobPositionRequirements> </JobPositionInformation> <HowToApply> <ApplicationMethods> <ByEmail/> <ByWeb/> </ApplicationMethods> </HowToApply> </JobPositionPosting></JobPositionPostings><JobPositionPostings> <JobPositionPosting> <jobpositionpostingid>1300000T</jobpositionpostingid> <HiringOrg> <Industry> <summarytext>Project Manager</summarytext> </Industry> <Contact> <PersonName/> </Contact> </HiringOrg> <JobDisplayOptions/> <JobPositionInformation> <JobClassifications> <PrimaryJobCategory/> </JobClassifications> <JobPositionDescription/> <JobPositionLocation/> <CompensationDescription> <Pay/> </CompensationDescription> <JobPositionRequirements> <JobExperience/> <JobQualifications/> </JobPositionRequirements> </JobPositionInformation> <HowToApply> <ApplicationMethods> <ByEmail/> <ByWeb/> </ApplicationMethods> </HowToApply> </JobPositionPosting></JobPositionPostings> i want that Root tag <JobPositionPostings> just as root tag(open and close one time) but its repeating for every row please suggest me any solution for this.thanks in advance.
  21. hi everbody, i m very new to xsl.my requirement is transform a flat xml to nested xml using xsl transform for that i have to pass xml template file which contain xsl file path ,name and record placeholder.i dont knw how my template file ll be. my input xml file is input.xml <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getDocumentByKeyResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://www.taleo.com/ws/integration/toolkit/2005/07"><Document xmlns="http://www.taleo.com/ws/integration/toolkit/2005/07"><Attributes><Attribute name="duration">0:00:00.130</Attribute><Attribute name="count">7</Attribute><Attribute name="entity">Requisition</Attribute><Attribute name="mode">XML</Attribute><Attribute name="version">http://www.taleo.com/ws/tee800/2009/01</Attribute></Attributes><Content> <ExportXML xmlns="http://www.taleo.com/ws/integration/toolkit/2005/07"> <record> <field name="ContestNumber">1300000F</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> <record> <field name="ContestNumber">1300000H</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> <record> <field name="ContestNumber">1300000T</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> <record> <field name="ContestNumber">13000018</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> </ExportXML></Content></Document></ns1:getDocumentByKeyResponse></soapenv:Body></soapenv:Envelope> my xslt file is <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:itk="http://www.taleo.com/ws/integration/toolkit/2005/07"> <xsl:output method="text" encoding="UTF-8"/> <xsl:template match="itk:record"> <xsl:text>JOB INFORMTION</xsl:text> <xsl:value-of select="itk:field[@name=ContestNumber]"/> <xsl:text>|</xsl:text> <xsl:value-of select="itk:field[@name=ManagerRequisitionTitle]"/> <xsl:text disable-output-escaping="yes"> </xsl:text> <xsl:text>====</xsl:text> <xsl:text disable-output-escaping="yes"> </xsl:text> </xsl:template> </xsl:stylesheet> my expected output xml is output.xml <?xml version="1.0" encoding="UTF-8" ?> <JobPositionPostings><JobPositionPosting><JobPositionPostingID>1300000F</JobPositionPostingID> <Industry><jobPost>Project Manager</jobPost> </Industry></JobPositionPosting></JobPositionPostings> for xml input template file i dont have more idea about record place holder .please suggest me how it ll look like. i created like this <?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl" href="mycustom.xsl"?> after that how to place xsl fetch value in this i dont know.
  22. Hi, I am a beginner in xml.I need to include a picture in my xslt page which is linked to my xml page, so when the xml page is viewed, the picture shows.But I cant seem to get the syntax right.Can anyone help please?
  23. Hi,I am not an IT guy (I am a paleontologist =) and my mother-tongue is not English. I have built few small websites: for instance, one for an open access scientific journal, that I am keeping on maintaining and upgrading. For some of them I have had the possibility to use PHP and MySQL (I manage to write .inc and .php files, but obviously it is not me but my IT colleagues at the University who take care of the server issues!). For other sites I can only use HTML (no PHP, no PERL, no ASP, ...). Therefore sometimes I have to manipulate a little javascript and when I combine pieces of code I get something that works and which is quite useful.Of course sometimes it isfrustrating to be unable to use a server-based database but it forces me to look for solutions elsewhere ... and actually it is fine to have tools and data which are not server-based, that is you can run from your PC (or Mac) or from a CD/DVD. The scientific journal I am publishing get a yearly DVD version and we use a very efficient JS search engine to explore it ("Tipue"). Recently I have build an XML (-like) file with some 7,500 entries. I used some pieces of scripts given in examples of the W3Schools and combine them in order to parse this flat database :1) to display some data corresponding to a certain id/an ordering number out of the 7,500 (display1: name, year, title), then by clicking on it getting a larger set of data for the same id (display2: name, year, title, reference, abstract, keywords);2) to browse up and down the entries, one after the other, with an increment of one, five or twenty, or to be able to go to a certain id by entering its id number in a form.This database will be used to document an open access web publication about FOSSIL corals and sponges (you can see that my fields of interests are quite far from programming!). This script I "built" WORKS on my PC with Firefox,http://paleopolis.re...rowse_test.htmlbut not with Chrome (nor Safari). Chrome gives me 4 errors but I am unable to understand them (it is Chinese to me). The file FCnP.xml is at the same level as the browse_test.html ...It also works on my spouse's Ipad! Is there anybody to help me? Here is the HTML code : <!DOCTYPE html><html><head><script language="javascript1.3">if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.open("GET","FCnP.xml",false);xmlhttp.send();xmlDoc=xmlhttp.responseXML;x=xmlDoc.getElementsByTagName("RECORD");i=0;function displayCD(){id=(x[i].getElementsByTagName("ID")[0].childNodes[0].nodeValue);artist=(x[i].getElementsByTagName("AUTHORS")[0].childNodes[0].nodeValue);year=(x[i].getElementsByTagName("YEAR")[0].childNodes[0].nodeValue);title=(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);txt= id + " - Author(s): " + artist + "<br>Year: "+ year + "<br>Title: " + title;document.getElementById("showCD").innerHTML=txt;}function displayCDInfo(){artist=(x[i].getElementsByTagName("AUTHORS")[0].childNodes[0].nodeValue);year=(x[i].getElementsByTagName("YEAR")[0].childNodes[0].nodeValue);title=(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);source=(x[i].getElementsByTagName("SOURCE")[0].childNodes[0].nodeValue);abstr=(x[i].getElementsByTagName("ABSTRACT")[0].childNodes[0].nodeValue);fcnp=(x[i].getElementsByTagName("FCnP")[0].childNodes[0].nodeValue);subject=(x[i].getElementsByTagName("SUBJECT")[0].childNodes[0].nodeValue);syst=(x[i].getElementsByTagName("SYST")[0].childNodes[0].nodeValue);strat=(x[i].getElementsByTagName("STRAT")[0].childNodes[0].nodeValue);geog=(x[i].getElementsByTagName("GEOG")[0].childNodes[0].nodeValue);txt= artist + " (<b>" + year + "</b>).- " + title + "- " + source + " - <b>FC&P:</b> " + fcnp + "<br><b>Abstract:</b> " + abstr + "<br>Topic(s): " + subject + "<br>Systematics: " + syst + "<br>Stratigraphy: " + strat + "<br>Geography: " + geog;document.getElementById("showCD").innerHTML=txt;}function next(){if (i<x.length-1) { i++; displayCD(); }}function previous(){if (i>0) { i--; displayCD(); }}function next5(){if (i<x.length-1) { i+=5; displayCD(); }}function previous5(){if (i>5) { i-=5; displayCD(); }}function next20(){if (i<x.length-1) { i+=20; displayCD(); }}function previous20(){if (i>20) { i-=20; displayCD(); }}function goForit(){if (i<6708) { i=+this.document.testform.inputbox.value; displayCD(); }}</script></head><body onload="displayCD()"><script language="javascript1.3">document.write("<p>");if (i==0) { document.write("<div id='showCD' onclick='displayCDInfo(" + i + ")'></div>"); }elsefor (i=1;i<x.length;i++) { document.write("<div id='showCD(" + i + ")' onclick='displayCDInfo(" + i + ")'></div>"); }document.write("</p>");</script><form name="testform"><input type="button" onclick="previous20()" value="-20" /><input type="button" onclick="previous5()" value="-5" /><input type="button" onclick="previous()" value="-1" /><input type="text" name="inputbox" value="" size="5"><input type="button" name="Enter" Value="Enter" onClick="goForit(this.form)"><input type="button" name="Reload" value="Reload" onClick="window.location.reload()"><input type="button" onclick="next()" value="+1" /><input type="button" onclick="next5()" value="+5" /><input type="button" onclick="next20()" value="+20" /></form></body></html> It would be great (and acknowledged), if someone could provide us with solutions to these problems OR an alternative way to get the same (actually better) results.I believe that this simple assemblage of function could be very usefull for many colleagues of mine (paleontologists, ...). I thank you in advance for your time and consideration.=) BG
  24. Help compare between Xpath and SQL, details is Good. Thanks you.Thanks you.Thanks you.Thanks you.
  25. As a first-time learner of XSD, I found the use of "http://www.w3schools.com" as an example of a namespace and "http://www.w3schools.com/XMLSchema" as a literal namespace to be confusing. Perhaps where "http://www.w3schools.com/" is not literrally used, it might be better to use "example.com". Visit this link to see what I'm talking about: http://www.w3schools.com/schema/schema_schema.asp After I figured that part out, the rest was good. Thanks.
×
×
  • Create New...