Jump to content

groads2

Members
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral

About groads2

  • Rank
    Newbie
  1. I have an xml that contains both types of notation. Being new to xslt I don't know how I should handle this. I have attached the xml. My style sheet does not traverse through the part that has the escaped characters (>). <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns5:CorrelatedMessageResponse xmlns:ns1="http://niem.gov/niem/appinfo/2.0" xmlns:ns2="http://niem.gov/niem/structures/2.0" xmlns:ns3="https://collect.prodcjis.ct.gov/ctsp/ext/1.0" xmlns:ns4="https://collect.prodcjis.ct.gov/ctsp/cjis/1.0" xmlns:ns5="https://collect.prodcjis.ct.gov/ctsp/queries/1.0" xmlns:ns6="https://collect.prodcjis.ct.gov/ctsp/messages/1.0" xmlns:ns7="https://collect.prodcjis.ct.gov/ctsp/NLETS/1.0"><ns3:ResponseFormat>XML</ns3:ResponseFormat><ns5:MessageResponse><?xml version="1.0" encoding="UTF-8"?><ncic:Message xmlns:cjis="http://cjis.fbi.gov/1.0.0" xmlns:ncic="http://cjis.fbi.gov/ncic/1.0.5" xmlns:n-art="http://cjis.fbi.gov/ncic/1.0.5/article" xmlns:n-boa="http://cjis.fbi.gov/ncic/1.0.5/boat" xmlns:n-gun="http://cjis.fbi.gov/ncic/1.0.5/gun" xmlns:n-ide="http://cjis.fbi.gov/ncic/1.0.5/identitytheft" xmlns:n-ima="http://cjis.fbi.gov/ncic/1.0.5/image" xmlns:n-lic="http://cjis.fbi.gov/ncic/1.0.5/licenseplate" xmlns:n-mis="http://cjis.fbi.gov/ncic/1.0.5/missingperson" xmlns:n-ori="http://cjis.fbi.gov/ncic/1.0.5/ori" xmlns:n-pro="http://cjis.fbi.gov/ncic/1.0.5/protectionorder" xmlns:n-sec="http://cjis.fbi.gov/ncic/1.0.5/securities" xmlns:n-sen="http://cjis.fbi.gov/ncic/1.0.5/sentry" xmlns:n-######="http://cjis.fbi.gov/ncic/1.0.5/sexualoffender" xmlns:n-sup="http://cjis.fbi.gov/ncic/1.0.5/supervisedrelease" xmlns:n-uni="http://cjis.fbi.gov/ncic/1.0.5/unidentifiedperson" xmlns:n-vbp="http://cjis.fbi.gov/ncic/1.0.5/vehicleboatpart" xmlns:n-veh="http://cjis.fbi.gov/ncic/1.0.5/vehicle" xmlns:n-vgt="http://cjis.fbi.gov/ncic/1.0.5/vgtof" xmlns:n-wan="http://cjis.fbi.gov/ncic/1.0.5/wantedperson" xmlns:n-irr="http://cjis.fbi.gov/ncic/1.0.5/irregular" xmlns:jxdm="http://www.it.ojp.gov/jxdm/3.0.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><cjis:HeaderSection><cjis:TransactionKeyText>QV</cjis:TransactionKeyText><cjis:TransactionHeaderText>1N01UIPSC22498</cjis:TransactionHeaderText><cjis:TransactionOrganization><jxdm:OrganizationORIID><jxdm:ID>CT0010600</jxdm:ID></jxdm:OrganizationORIID></cjis:TransactionOrganization></cjis:HeaderSection><ncic:ResponseDataSection><ncic:NoHitDataSection><ncic:PropertyNoHitResponse><cjis:CaveatText cjis:type="NoHit">NO RECORD</cjis:CaveatText><jxdm:VehicleRegistrationPlateID><jxdm:ID>700KNU</jxdm:ID></jxdm:VehicleRegistrationPlateID></ncic:PropertyNoHitResponse></ncic:NoHitDataSection></ncic:ResponseDataSection><n-veh:QueryDataSection><n-veh:VehicleQuery><jxdm:VehicleRegistrationPlateID xsi:type="ncic:PlateIDType"><jxdm:ID>700KNU</jxdm:ID></jxdm:VehicleRegistrationPlateID><jxdm:PropertyImage><jxdm:BinaryAvailableIndicator>true</jxdm:BinaryAvailableIndicator></jxdm:PropertyImage></n-veh:VehicleQuery></n-veh:QueryDataSection></ncic:Message></ns5:MessageResponse></ns5:CorrelatedMessageResponse></soapenv:Body></soapenv:Envelope>
  2. I have this blob of text in on of the xml strings that I am receiving and transforming to html with xsl 1.0. I need to display it with all the white space preserved in a chromium object. I have read as much as someone can read on the subject of using xsl to transform this to html with the whitespace and tried a lot of those suggestions without getting the html to display correctly in the browser window. I have attached the xml. Anyone have a solution? Thanks.
  3. Thanks Martin. That was what I was looking for.
  4. I had an html form that has several tables. Sometime there is no xml data to file the table with and the table is filled entirely with the <tr> row that has the <th>. I need the row containing the <th> to maintain a size of 20px and not consume the entire table when there are no data rows.this is an example of what I am refering too. <html><head></head><body><div style="border:1px solid red;width:600px;height:400px"><table style="border:1px solid blue;width:300px;height:200px"><tr style="height:10px"><th style="text-align:center;background-color:blue;height:10px">header</th></tr></table><div></body></html>
  5. I have an xml that will have 10 instances of a tag. I want to put each instance in a certain place on my html form. How do I select the specific occurance of an xml tag?
  6. Thanks Martin. I am new to xsl transformation and I am just not understanding parts of the xsl transformation. When I read that something returns the node, I expect the whole node including tags such as <car>Ford</car> not just the value of "Ford". So my delima continues. I have a the following xml, xsl and result below. I really want my far to have the xml with no name spaces. So How can I get the nodes such as <??>???</??> into my variable? Thanks. Also am I missing some fundamental aspect of the transformation process or is it just a lack of experience? Thanks again. my test xml: <?xml version="1.0" encoding="utf-8"?><n1:treasure xmlns:n1="myNamespace"><piles><moreStuff> <theStuff>gary</theStuff> <theStuff>troy</theStuff></moreStuff><n1:otherStuff> <junk>aaa</junk> <junk>bbb</junk></n1:otherStuff></piles><misc> <item1>item one</item1> <item2>item two</item2></misc></n1:treasure> my current (after many tests) XSLT: <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:n1="myNamespace"><xsl:output method="html"/> <xsl:variable name="jnker"> <xsl:for-each select="*"> <xsl:element name="{local-name()}"> <xsl:copy-of select="."/> </xsl:element> </xsl:for-each></xsl:variable> <xsl:template match="n1:treasure"> <html> <head> <script language="javascript"> $(document).ready(function(){ var vjunder = "<xsl:value-of select="$jnker"/>"; }); </script> </head> <body> <div id="here">Here I am</div> </body></html></xsl:template> </xsl:stylesheet> The results that I constantly get, with the variable not having xml but a string of values. <html xmlns:n1="myNamespace"> <head> <META http-equiv="Content-Type" content="text/html; charset=utf-16"><script language="javascript"> $(document).ready(function(){ var vjunder = " gary troy aaa bbb item one item two";}); </script></head> <body> <div id="here">Here I am</div> </body></html>
  7. I am using Saxon to transform my xml to html. The parser is having a problem with the '&&'. I am just starting with xsl transformation. Can anyone give me some insight as to what the problem may be, and possibly how I can get around it? Thanks. The error is:Error on line 23 column 43 of stufferPVB.xsl: SXXP0003: Error reported by XML parser: The entity name must immediately follow the '&' in the entity reference.Failed to compile stylesheet. 1 error detected. <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:n1="myNamespace"><xsl:output method="html"/><xsl:strip-space elements="ns6:RecentInquiries"/><xsl:template match="PersonVehicleBoatQueryResponse"> <html> <head> <link rel="stylesheet" href="screen2.css" type="text/css" media="screen" /> <link rel="stylesheet" type="text/css" href="ui.jqgrid.css" /> <link rel="stylesheet" id="Link1" type="text/css" href="redmond_ui.css" /> <script src="jquery-1.5.2.min.htm.js" type="text/javascript"></script> <script src="jquery-ui-1.8.16.min.htm.js" type="text/javascript"></script> <script src="grid.locale-en.htm.js" type="text/javascript"></script> <script src="jquery.jqGrid.min.htm.js" type="text/javascript"></script> <script type="text/javascript" src="tabbed.layout.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function(){ // recent Persons Inquiries var recentPersonData = '<xsl:call-template name="getRecentPersonData"/>' if (recentPersonData != null && recentPersonData != '') { jQuery("#gridRecentPersonInquiry").jqGrid({ xmlReader: { root: "RecentInquiries", row: "RecentPersonNameInquiry", page: "rows>page", total: "rows>total", records: "rows>records", repeatitems: false, id: "OrganizationORIID" }, datatype: 'xmlstring', datastr: recentPersonData, colNames: ['First', 'Middle', 'Last', 'DOB', '######', 'Operator', 'ORI', 'Date', 'Time'], colModel: [ { name: 'PersonGivenName', index: 'PersonGivenName', width: 40 },{ name: 'PersonMiddleName', index: 'PersonMiddleName', width: 20 }, { name: 'PersonLastName', index: 'PersonLastName', width: 40 }, { name: 'PersonBirthDate', index: 'PersonBirthDate', width: 30 }, { name: 'PersonSexCode', index: 'PersonSexCode', width: 20 },{ name: 'Operator', index: 'Operator', width: 25 },{ name: 'OrganizationORIID', index: 'OrganizationORIID', width: 30 },{ name: 'InquiryDate', index: 'InquiryDate', width: 20 },{ name: 'InquiryTime', index: 'InquiryTime', width: 20 } ], forceFit:true, gridview: true, shrinkToFit:true, rowNum: 6, rowList: [6, 12, 18], pager: '#pagerRecentPersonInquiry', caption: 'Recent Person Inquiries ', width: 800, height: 140, sortname: 'Date', sortorder: 'asc', hidegrid: false }); } else { // there are no person recent inquires. do you want to do anything? } }); </script> </head> <body> <header> <h1 id="BodyHeader">Drivers License</h1> </header> <nav> <ul> <li><a href="#tab1">Hit Lists</a></li> <li><a href="#tab2">Collect</a></li> <li><a href="#tab3">Recent Inquiries</a></li> <li><a href="#tab4">DMV</a></li> <li><a href="#tab5">NCIC</a></li> </ul> </nav> <section class="tab" id="tab3"> <p> <div align="center" ID="DivRecentPersonInquiry"> <input type="hidden" name="RecentPersonData" value ="" id="RecentPersonData" tabindex="0" style="display: none;" /> <div id="tableHolder1"> <table id="gridRecentPersonInquiry"></table> <div id="pagerRecentPersonInquiry"></div> </div> </div> <div align="center" ID="DivRecentRegInquiry"> <input type="hidden" name="RecentRegData" value="" id="RecentRegData" tabindex="0" style="display: none;" /> <div id="tableHolder2" align="center"> <table id="gridRecentRegInquiry"></table> <div id="pagerRecentRegInquiry"></div> </div> </div> </p> </section> </body></html></xsl:template> <xsl:template name="getRecentPersonData"> <xsl:if test="ns6:RecentInquiries/ns6:RecentPersonNameInquiry"> <xsl:element name="RecentInquiries"> <xsl:copy-of select="//ns6:RecentInquiries/ns6:RecentPersonNameInquiry"/> </xsl:element> </xsl:if></xsl:template> <xsl:template name="getmoreStuff"><xsl:if test="moreStuff"> <xsl:element name="joe"> <xsl:copy-of select="moreStuff"/> </xsl:element></xsl:if></xsl:template> <xsl:template name="getOtherStuff"> <xsl:copy-of select="n1:otherStuff"/> </xsl:template> <xsl:template match="misc"></xsl:template> </xsl:stylesheet>
  8. I have a really large xml document that I need to display in an HTML form. I am using xsl to transform into an html. Is it possible to alter the xml that is being transformed with the xsl and continue transforming it after it has been altered? I am really thinking of removing or changing some of the namespacing. Thanks.
  9. Hi: I just started with xsl transformation a couple of days ago. I got assigned a project to handle the display of xml documents, OJT is good but difficult sometimes. I found that the xml document comes to me with different namespace declarations at different times. I am using altova xml spy to test my transformation and It looks like my stylesheet needs the exact namespace names and urls that is in the original xml before it gets transformed correctly. While looking over a variety of the documents samples I noticed that sometimes I will have xmlns;ns5="thisurl" and the next time it could be xmlns:ns5="otherURL" and xmlns:ns6="thisurl". I hope I explained this in a manner that makes sense. I don't now how I can handle this? Any help will be greatly appreciated. <stuff xmlns:ns5="thisurl"> <ns5:morestuff>this is it</ns5:morestuff></stuff> next time it may be like this <stuff xmlns:ns5="otherUrl" xmlns:ns6="thisurl"> <ns6:morestuff> <ns5:littestuff>this bit</ns5:littlestuff></ns6:morestuff><stuff>
×
×
  • Create New...