Jump to content

scopley

Members
  • Content Count

    28
  • Joined

  • Last visited

Everything posted by scopley

  1. Does anyone know of a way to extract graphic entity paths from XML files using XSLT or any other type of language? Here is a portion of the XML I want to extract the !ENTITY PATH information from: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mpc SYSTEM "C:xmlmpcxmlmpc.dtd" [ <!ENTITY mh65d2210032a31 SYSTEM "G:MH65DPublication IllustrationsMPCm2214501.cgm" NDATA cgm> ]> <mpc model="65" mpcid="m2214501" type="gen"> <reas>Administrative/Operational use</reas> <office>the appropriate asset product line</office> <idinfo>......</idinfo> </mpc> Thanks in advance.
  2. YOU ARE WITHOUT A DOUBT THE BOMB!! Thank you so much!! I took out the line and it worked great. And YES I am a very basic beginner when it comes to AJAX. Thanks so much and have a great day!!!
  3. Thanks so much for your response. I have looked until my brain is tired and I can't seem to make this work.My HTML to execute this file is <input type="text" id="perfTxt" name="perfTxt" onkeyup="ajax_showOptions(this, 'tempVar', event);" /> Here is my entire file. Sorry for it being so lengthy. Hope this makes sense.:var ajaxBox_offsetX = 0;var ajaxBox_offsetY = 0;//path to external filevar ajax_list_externalFile = 'gethint.php';//number of letters entered before a lookup is performedvar minimumLettersBeforeLookup = 1;var ajax_list_objects = new Array();var ajax_list_cachedLists = new Array();var ajax_list_activeInput = false;var ajax_list_activeItem;var ajax_list_optionDivFirstItem = false;var ajax_list_currentLetters = new Array();var ajax_optionDiv = false;var ajax_optionDiv_iframe = false;var ajax_list_MSIE = false;if(navigator.userAgent.indexOf('MSIE') >= 0 && navigator.userAgent.indexOf('Opera') < 0){ ajax_list_MSIE = true; }var currentListIndex = 0;function ajax_getTopPos(inputObj){ var returnValue = inputObj.offsetTop; while((inputObj = inputObj.offsetParent) != null) { returnValue += inputObj.offsetTop; } return returnValue;}function ajax_list_cancelEvent(){ return false; }function ajax_getLeftPos(inputObj){ var returnValue = inputObj.offsetLeft; while((inputObj = inputObj.offsetParent) != null) { returnValue += inputObj.offsetLeft; } return returnValue;}function ajax_option_setValue(e, inputObj){ if(!inputObj) { inputObj = this; } var tmpValue = inputObj.innerHTML; if(ajax_list_MSIE) { tmpValue = inputObj.innerText; } else { tmpValue = inputObj.textContent; } if(!tmpValue) { tmpValue = inputObj.innerHTML; } ajax_list_activeInput.value = tmpValue; if(document.getElementById(ajax_list_activeInput.name + '_hidden')) { document.getElementById(ajax_list_activeInput.name + '_hidden').value = inputObj.id; } ajax_options_hide();}function ajax_options_hide(){ if(ajax_optionDiv) { ajax_optionDiv.style.display = 'none'; } if(ajax_optionDiv_iframe) { ajax_optionDiv_iframe.style.display = 'none'; }}function ajax_options_rollOverActiveItem(item, fromKeyBoard){ if(ajax_list_activeItem) { ajax_list_activeItem.className = 'optionDiv'; } item.className = 'optionDivSelected'; ajax_list_activeItem = item; if(fromKeyBoard) { if(ajax_list_activeItem.offsetTop > ajax_optionDiv.offsetHeight) { ajax_optionDiv.scrollTop = ajax_list_activeItem.offsetTop - ajax_optionDiv.offsetHeight + ajax_list_activeItem.offsetHeight + 2; } if(ajax_list_activeItem.offsetTop < ajax_optionDiv.scrollTop) { ajax_optionDiv.scrollTop = 0; } }}function ajax_option_list_buildList(letters, paramToExternalFile){ ajax_optionDiv.innerHTML = ''; ajax_list_activeitem = false; if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length <= 1) { ajax_options_hide(); return; } ajax_list_optionDivFirstItem = false; var optionsAdded = false; for(var no = 0; no < ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length; no++) { if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()][no].length == 0) { continue; } optionsAdded = true; var div = document.createElement('DIV'); var items = ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()][no].split(/###/gi); if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length == 1 && ajax_list_activeInput.value == items[0]) { ajax_options_hide(); return; } div.innerHTML = items[items.length - 1]; div.id = items[0]; div.className = 'optionDiv'; div.onmouseover = function() { ajax_options_rollOverActiveItem(this, false) } div.onclick = ajax_option_setValue; if(!ajax_list_optionDivFirstItem) { ajax_list_optionDivFirstItem = div; } ajax_optionDiv.appendChild(div); } if(optionsAdded) { ajax_optionDiv.style.display = 'block'; if(ajax_optionDiv_iframe) { ajax_optionDiv_iframe.style.display = ''; } ajax_options_rollOverActiveItem(ajax_list_optionDivFirstItem, true); }}function ajax_option_list_showContent(ajaxIndex, inputObj, paramToExternalFile, whichIndex){ if(whichIndex != currentListIndex) { return; } var letters = inputObj.value; var content = ajax_list_objects[ajaxIndex].response; var elements = content.split('|'); ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()] = elements; ajax_option_list_buildList(letters, paramToExternalFile);}function ajax_option_resize(inputObj){ ajax_optionDiv.style.top = (ajax_getTopPos(inputObj) + inputObj.offsetHeight + ajaxBox_offsetY) + 'px'; ajax_optionDiv.style.left = (ajax_getLeftPos(inputObj) + ajaxBox_offsetX) + 'px'; if(ajax_optionDiv_iframe) { ajax_optionDiv_iframe.style.left = ajax_optionDiv.style.left; ajax_optionDiv_iframe.style.top = ajax_optionDiv.style.top; }}function ajax_showOptions(inputObj, paramToExternalFile, e){ if(e.keyCode == 13 || e.keyCode == 9) { return; } if(ajax_list_currentLetters[inputObj.name] == inputObj.value) { return; } if(!ajax_list_cachedLists[paramToExternalFile]) { ajax_list_cachedLists[paramToExternalFile] = new Array(); } ajax_list_currentLetters[inputObj.name] = inputObj.value; if(!ajax_optionDiv) { ajax_optionDiv = document.createElement('DIV'); ajax_optionDiv.id = 'ajax_listOfOptions'; document.body.appendChild(ajax_optionDiv); if(ajax_list_MSIE) { ajax_optionDiv_iframe = document.createElement('IFRAME'); ajax_optionDiv_iframe.border = '0'; ajax_optionDiv_iframe.style.width = ajax_optionDiv.clientWidth + 'px'; ajax_optionDiv_iframe.style.height = ajax_optionDiv.clientHeight + 'px'; ajax_optionDiv_iframe.id = 'ajax_listOfOptions_iframe'; document.body.appendChild(ajax_optionDiv_iframe); } var allInputs = document.getElementsByTagName('INPUT'); for(var no = 0; no < allInputs.length; no++) { if(!allInputs[no].onkeyup) { allInputs[no].onfocus = ajax_options_hide; } } var allSelects = document.getElementsByTagName('SELECT'); for(var no = 0; no < allSelects.length; no++) { allSelects[no].onfocus = ajax_options_hide; } var oldonkeydown = document.body.onkeydown; if(typeof oldonkeydown != 'function') { document.body.onkeydown = ajax_option_keyNavigation; } else { document.body.onkeydown = function() { oldonkeydown(); ajax_option_keyNavigation(); } } var oldonresize = document.body.onresize; if(typeof oldonresize != 'function') { document.body.onresize = function() { ajax_option_resize(inputObj); }; } else { document.body.onresize = function() { oldonresize(); ajax_option_resize(inputObj); } } } if(inputObj.value.length < minimumLettersBeforeLookup) { ajax_options_hide(); return; } ajax_optionDiv.style.top = (ajax_getTopPos(inputObj) + inputObj.offsetHeight + ajaxBox_offsetY) + 'px'; ajax_optionDiv.style.left = (ajax_getLeftPos(inputObj) + ajaxBox_offsetX) + 'px'; if(ajax_optionDiv_iframe) { ajax_optionDiv_iframe.style.left = ajax_optionDiv.style.left; ajax_optionDiv_iframe.style.top = ajax_optionDiv.style.top;; } ajax_list_activeInput = inputObj; ajax_optionDiv.onselectstart = ajax_list_cancelEvent; currentListIndex++; if(ajax_list_cachedLists[paramToExternalFile][inputObj.value.toLowerCase()]) { ajax_option_list_buildList(inputObj.value, paramToExternalFile, currentListIndex); } else { var tmpIndex = currentListIndex / 1; ajax_optionDiv.innerHTML = ''; var ajaxIndex = ajax_list_objects.length; ajax_list_objects[ajaxIndex] = new sack(); var url = ajax_list_externalFile + '?' + paramToExternalFile + '=1&search=' + inputObj.value.replace(" ", "+"); //specifying which file to get ajax_list_objects[ajaxIndex].requestFile = url; ajax_list_objects[ajaxIndex].onCompletion = function() { //specify function that will be executed after file has been found ajax_option_list_showContent(ajaxIndex, inputObj, paramToExternalFile, tmpIndex); }; //execute AJAX function ajax_list_objects[ajaxIndex].runAJAX(); }}function ajax_option_keyNavigation(e){ if(document.all) { e = event; } if(!ajax_optionDiv) { return; } if(ajax_optionDiv.style.display == 'none') { return; } //up arrow if(e.keyCode == 38) { if(!ajax_list_activeItem) { return; } if(ajax_list_activeItem && !ajax_list_activeItem.previousSibling) { return; } ajax_options_rollOverActiveItem(ajax_list_activeItem.previousSibling, true); } //down arrow if(e.keyCode == 40) { if(!ajax_list_activeItem) { ajax_options_rollOverActiveItem(ajax_list_optionDivFirstItem, true); } else { if(!ajax_list_activeItem.nextSibling) { return; } ajax_options_rollOverActiveItem(ajax_list_activeItem.nextSibling, true); } } //enter key or tab key if(e.keyCode == 13 || e.keyCode == 9) { if(ajax_list_activeItem && ajax_list_activeItem.className == 'optionDivSelected') { ajax_option_setValue(false, ajax_list_activeItem); } if(e.keyCode == 13) { //document.getElementById('searchBtn').focus(); return false; } else { return true; } } //escape key if(e.keyCode == 27) { ajax_options_hide(); ajax_list_objects = []; ajax_list_cachedLists = []; }}document.documentElement.onclick = autoHideList;function autoHideList(e){ if(document.all) { e = event; } if(e.target) { source = e.target; } else if(e.srcElement) { source = e.srcElement; } //safari bug if(source.nodeType == 3) { source = source.parentNode; } if(source.tagName.toLowerCase() != 'input' && source.tagName.toLowerCase() != 'textarea') { ajax_options_hide(); }}
  4. I hope this is the right place to post this so here goes.I'm using AJAX to autopopulate a dropdown list as the user types in e-mail address. This all works great it pulls the values, creates the dropdown as the user is typing, however as soon as the user types enough letters to make the value unique the dropdown disappears.For example I have these 3 values:John.W.SmithJohn.W.KittelJohn.A.RountreeAs soon as the user gets to the A in the name the dropdown disappears.Here is my PHP code: function getEmail($conn){ $query = "select EMAIL_ADR from COMMON.EMAILS order by EMAIL_ADR"; $emailResults = oci_parse($conn, $query); oci_execute($emailResults); $emails = array(); while ($item = oci_fetch_array($emailResults)) // loop resulting rows, one by one { $emails[] = $item['EMAIL_ADR']; } return $emails;}$users = getEmail($conn);//get the search parameter from URL$query=$_GET["search"];//lookup all hints from array if length of search>0if (strlen($query) > 0){ $result=""; for($i=0; $i<count($users); $i++) { if (strtolower($query)==strtolower(substr($users[$i],0,strlen($query)))) { if ($result=="") { $result=$users[$i]; } else { echo $i + 1 . "###" . $users[$i] . "|"; } } }}// Set output to "No Search Results Found" if no results were found// or to the correct valuesif ($result == ""){ $response="No Search Results Found"; }else{ $response=$result; }//output the responseecho $response;?> Here is my javascript code: function ajax_showOptions(inputObj, paramToExternalFile, e){ if(e.keyCode == 13 || e.keyCode == 9) { return; } if(ajax_list_currentLetters[inputObj.name] == inputObj.value) { return; } if(!ajax_list_cachedLists[paramToExternalFile]) { ajax_list_cachedLists[paramToExternalFile] = new Array(); } ajax_list_currentLetters[inputObj.name] = inputObj.value; if(!ajax_optionDiv) { ajax_optionDiv = document.createElement('DIV'); ajax_optionDiv.id = 'ajax_listOfOptions'; document.body.appendChild(ajax_optionDiv); if(ajax_list_MSIE) { ajax_optionDiv_iframe = document.createElement('IFRAME'); ajax_optionDiv_iframe.border = '0'; ajax_optionDiv_iframe.style.width = ajax_optionDiv.clientWidth + 'px'; ajax_optionDiv_iframe.style.height = ajax_optionDiv.clientHeight + 'px'; ajax_optionDiv_iframe.id = 'ajax_listOfOptions_iframe'; document.body.appendChild(ajax_optionDiv_iframe); } var allInputs = document.getElementsByTagName('INPUT'); for(var no = 0; no < allInputs.length; no++) { if(!allInputs[no].onkeyup) { allInputs[no].onfocus = ajax_options_hide; } } var allSelects = document.getElementsByTagName('SELECT'); for(var no = 0; no < allSelects.length; no++) { allSelects[no].onfocus = ajax_options_hide; } var oldonkeydown = document.body.onkeydown; if(typeof oldonkeydown != 'function') { document.body.onkeydown = ajax_option_keyNavigation; } else { document.body.onkeydown = function() { oldonkeydown(); ajax_option_keyNavigation(); } } var oldonresize = document.body.onresize; if(typeof oldonresize != 'function') { document.body.onresize = function() { ajax_option_resize(inputObj); }; } else { document.body.onresize = function() { oldonresize(); ajax_option_resize(inputObj); } } } if(inputObj.value.length < minimumLettersBeforeLookup) { ajax_options_hide(); return; } ajax_optionDiv.style.top = (ajax_getTopPos(inputObj) + inputObj.offsetHeight + ajaxBox_offsetY) + 'px'; ajax_optionDiv.style.left = (ajax_getLeftPos(inputObj) + ajaxBox_offsetX) + 'px'; if(ajax_optionDiv_iframe) { ajax_optionDiv_iframe.style.left = ajax_optionDiv.style.left; ajax_optionDiv_iframe.style.top = ajax_optionDiv.style.top;; } ajax_list_activeInput = inputObj; ajax_optionDiv.onselectstart = ajax_list_cancelEvent; currentListIndex++; if(ajax_list_cachedLists[paramToExternalFile][inputObj.value.toLowerCase()]) { ajax_option_list_buildList(inputObj.value, paramToExternalFile, currentListIndex); } else { var tmpIndex = currentListIndex / 1; ajax_optionDiv.innerHTML = ''; var ajaxIndex = ajax_list_objects.length; ajax_list_objects[ajaxIndex] = new sack(); var url = ajax_list_externalFile + '?' + paramToExternalFile + '=1&search=' + inputObj.value.replace(" ", "+"); //specifying which file to get ajax_list_objects[ajaxIndex].requestFile = url; ajax_list_objects[ajaxIndex].onCompletion = function() { //specify function that will be executed after file has been found ajax_option_list_showContent(ajaxIndex, inputObj, paramToExternalFile, tmpIndex); }; //execute AJAX function ajax_list_objects[ajaxIndex].runAJAX(); }} I am at a loss this is all new to me. Please help.
  5. When I have a figure in the middle of a chapter than needs to be set to an 11x17 pagesize and then go back to 8 1/2 x 11 pagesize it resets the page number to 1. I know that it is because my Chapter template has initial-page-number set to 1 but is there a way to work around that. Can I save the page number in a variable so that I can test for the value? Thanks for your help.Here is a snippet of the XML File:<mmchapter chapnbr="4" id="ch04" revdate="00/00/00"><mmfigure id="fig100"><mmsheet foldout="1"><mmeffect>ALL</mmeffect><mmgraphic chg="u" gnbr="c130h7930007a"/></mmsheet></mmfigure></mmchapter> Here is a snippet of my Chapter template: <xsl:template match="imm:mmchapter"><fo:page-sequence master-reference="master" initial-page-number="1"><fo:flow flow-name="body"><fo:block xsl:use-attribute-sets="headfoot top" text-align="center" font-size="14pt" space-after="10pt" padding-top="20pt" break-before="odd-page" id="{@id}">CHAPTER<xsl:value-of select="@chapnbr"/></fo:block><fo:block xsl:use-attribute-sets="headfoot bottom" text-align="center" font-size="14pt" space-after="25pt" padding-bottom="20pt"><xsl:value-of select="imm:mmtitle"/></fo:block><xsl:apply-templates/><fo:block id="{generate-id(.)}"/></fo:flow></fo:page-sequence></xsl:template> Here is a snippet of my figure template: <xsl:template match="imm:mmfigure"><xsl:variable name="total" select="@shttotal"/><xsl:choose><xsl:when test="imm:mmsheet/@foldout='1'"><fo:page-sequence master-reference="11x17" initial-page-number="auto-odd"><fo:flow flow-name="body11x17"><fo:block-container id="{@id}" xsl:use-attribute-sets="figsp" keep-together="always" span="all"><xsl:apply-templates/></fo:block-container></fo:flow></fo:page-sequence></xsl:when>
  6. I'm looking for a way to style a section with different page sizes throughout. Through the use of an attribute I'm able to switch between different pagemasters and get the sizing that I want however when it switches back to the 8.5x11 it resets page number back to one.I know that it is because I have my initial page number set to 1 on my chapter template so when it goes back to that page set it resets it to 1. Is there a way to make the initial page number attribute conditional or is there a better way to switch page sizes within a section?Any help would be greatly appreciated.
  7. Thanks so much for your response. I didn't think you could but thought I would give it a try. I'm try to create a different footer on the last page of a section IF the last page is odd. I've tried it with pagemasters but can only get it to work on page-postion first, it won't recognize page-position last.Oh Well back to the drawing board. Thanks again.
  8. I need to test the value of the last page number in a section. I have the fo:page-number-citation ref-id set and it is pulling the correct value, however I would like to save that value into a variable so that I can use it in xsl:if. Is there a way to save that into a variable?Any help would be greatly appreciated.
  9. I'm trying to create a footer that will only display on the last odd page of a section. I have tried different variations of the repeatable pagemasters but the best I can accomplish is a different first odd page footer. I understand that the processor formats in the first true instance of the pagemasters that is finds but how can I work around this to produce a different last odd page footer.I have even tried adding another fo:repeatable-page-master-alternatives with a maximum repeat of 1 still all I can accomplish the the first odd page footer in the section.Here is my pagemasters: <fo:page-sequence-master master-name="master"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference page-position="last" odd-or-even="odd" master-reference="PageMaster-odd-last"/> <fo:conditional-page-master-reference page-position="first" odd-or-even="odd" master-reference="PageMaster-odd"/> <fo:conditional-page-master-reference page-position="rest" odd-or-even="odd" master-reference="PageMaster-odd"/> <fo:conditional-page-master-reference odd-or-even="even" master-reference="PageMaster-even"/> <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/> </fo:repeatable-page-master-alternatives></fo:page-sequence-master> Thanks in advance for any help you can give.
  10. I have created an XSL FO stylesheet that utilizes the blank page pagemaster. What I'm trying to do, with no luck is, if a chapter ends on page 3 that the page number would read Page 3/4 blank. Does XSL FO have any type of object that would produce this type of result. This is pretty common in Technical publications so I'm hoping there is something.If someone could help me that would be great.
  11. This is going to be a little long but here goes: <xsl:template match="imm:imm"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="coverpg" margin-top="0.75in" margin-bottom="0.50in" margin-left="0.75in" margin-right="0.75in" page-height="11in" page-width="8.5in"> <fo:region-body region-name="cvr-body" margin-top="1.0in" margin-bottom="0.75in"/> <fo:region-before region-name="header-cvr" extent="1.0in"/> <fo:region-after region-name="footer-cvr" extent="1.0in"/> </fo:simple-page-master> <fo:simple-page-master master-name="PageMaster-odd" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.75in" margin-right="0.50in" page-height="11in" page-width="8.5in"> <fo:region-body region-name="body" margin-top="0.50in" margin-bottom="0.75in" column-count="2" column-gap="0.45in"/> <fo:region-before region-name="header-odd" extent="0.50in"/> <fo:region-after region-name="footer-odd" extent="0.50in"/> </fo:simple-page-master> <fo:simple-page-master master-name="PageMaster-even" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.50in" margin-right="0.75in" page-height="11in" page-width="8.5in"> <fo:region-body region-name="body" margin-top="0.50in" margin-bottom="0.75in" column-count="2" column-gap="0.45in"/> <fo:region-before region-name="header-even" extent="0.50in"/> <fo:region-after region-name="footer-even" extent="0.50in"/> </fo:simple-page-master> <fo:simple-page-master master-name="blank" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.50in" margin-right="0.50in" page-height="11in" page-width="8.5in"> <fo:region-body region-name="blank-body" margin-top="0.50in" margin-bottom="0.75in"/> <fo:region-before region-name="blank-before" extent="0.50in"/> <fo:region-after region-name="blank-after" extent="0.50in"/> </fo:simple-page-master> <fo:page-sequence-master master-name="cover"> <fo:single-page-master-reference master-reference="coverpg"/> <fo:single-page-master-reference master-reference="blank"/> </fo:page-sequence-master> <fo:page-sequence-master master-name="master"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/> <fo:conditional-page-master-reference master-reference="PageMaster-odd" odd-or-even="odd"/> <fo:conditional-page-master-reference master-reference="PageMaster-even" odd-or-even="even"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </fo:layout-master-set> <xsl:apply-templates/> </fo:root> </xsl:template><!--**********************FOREWORD**********************--> <xsl:template match="imm:foreword"> <fo:page-sequence master-reference="master" initial-page-number="1" format="i"> <!--FOREWORD HEADER ODD--> <fo:static-content flow-name="header-odd"> <fo:block xsl:use-attribute-sets="headfoot" text-align="right"> <xsl:value-of select="$docname"/> </fo:block> </fo:static-content> <!--FOREWORD HEADER - EVEN--> <fo:static-content flow-name="header-even"> <fo:block xsl:use-attribute-sets="headfoot" text-align="left"> <xsl:value-of select="$docname"/> </fo:block> </fo:static-content> <!--FOREWORD FOOTER - ODD--> <fo:static-content flow-name="footer-odd"> <fo:block xsl:use-attribute-sets="headfoot" text-align="right"> <fo:page-number/> </fo:block> </fo:static-content> <!--FOREWORD FOOTER - EVEN--> <fo:static-content flow-name="footer-even"> <fo:block xsl:use-attribute-sets="headfoot" text-align="left"> <fo:page-number/> </fo:block> </fo:static-content> <fo:flow flow-name="body"> <fo:block xsl:use-attribute-sets="headfoot" text-align="center" font-size="14pt" space-after="25pt" break-before="odd-page">FOREWORD </fo:block> <xsl:for-each select="imm:para0"> <xsl:apply-templates/> </xsl:for-each> </fo:flow> </fo:page-sequence> </xsl:template> <!--TITLE--> <xsl:template match="imm:title"> <fo:block xsl:use-attribute-sets="title space"> <xsl:apply-templates/> </fo:block> </xsl:template> I really appreciate all your help.
  12. I'm writing an xsl:fo stylesheet but for some reason as soon as I add an apply templates I get this error message "Expecting 'fo:page-sequence' but found 'fo:block' which is not a valid child of 'fo:root' ".Here is the code that seems to be the problem. As soon as I add the apply-templates under the fo:block I get the error <xsl:template match="imm:foreword"><fo:page-sequence master-reference="master" initial-page-number="1" format="i"><fo:flow flow-name="body"><fo:block xsl:use-attribute-sets="headfoot" text-align="center" font-size="14pt" space-after="25pt" break-before="odd-page">FOREWORD</fo:block> <xsl:apply-templates/></fo:flow></fo:page-sequence></xsl:template><xsl:template match="imm:title"> <fo:block xsl:use-attribute-sets="title space"> <xsl:apply-templates/> </fo:block></xsl:template> Here is a snippet of the xml document I'm formatting: <para0 id="p1"><title>TITLE HERE</title></para0> For the life of me I can't understand why applying a template with an fo:block would cause this error. Please HELP!!
  13. Thanks so much for your response. The calstable.xsd is a generic table schema that I want to import into several other schemas that utilize the same table structure.
  14. I have created 2 schemas. I would like to import one into the other without a namespace. I believe that i have my xsd:schema tag set correctly for the import however when I open the schema it can't find the elements that are referenced inside the imported schema.Here is the top part of the original schema: <?xml version="1.0"?><xsd:schema xmlns="http://cgweb.arsc.uscg.mil/custom/doctypes/mm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cgweb.arsc.uscg.mil/custom/doctypes/mm" elementFormDefault="unqualified"> <xsd:import schemaLocation="calstable.xsd"/> Here is the top part of the imported schema: <?xml version="1.0"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> Any help is greatly appreciated.
  15. Have you tried the <xsl:sort> and set it to sort on the lowest price node??
  16. It sounds like what you may need is a sort on trade_description. Maybe something like this:<xsl:for-each select="/trades/trade"><xsl:sort select="trade_description"/>....</xsl:for-each>
  17. Problem has been solved by using the axes nodes. The following is a simplified version of the code: <xsl:template match="chapter"> <xsl:for-each select="descendant::prtrow"> <xsl:sort select="prtnbr" /> <row> <cell><xsl:value-of select="ancestor::chapter/@chapnbr"/></cell> <cell><xsl:value-of select="item"/></cell> <cell><xsl:value-of select="prtnbr"/></cell> <row> </xsl:for-each></xsl:template>
  18. I have written an XSL script and everything works great except the sorting. I need the data to sort by <prtnbr> but cannot accomplish this unless I remove 2 columns of required data that is generated by attributes.Here is a sample of the XML file: <chapter chapnbr="23" id="ch23"><section chapnbr="23" id="sc2320" sectnbr="20"><subject chapnbr="23" id="sj232000" sectnbr="20" subjnbr="00"><dpfigure chg="u" figcnt="10" id="sj23200010"><prtlist><prtrow><item>005</item><prtnbr>822-1071-001</prtnbr><qty>1</qty></prtrow><prtrow><item>010</item><prtnbr>372254-91</prtnbr><qty>1</qty></prtrow><prtrow><item>015</item><prtnbr>372254-93</prtnbr><qty>1</qty></prtrow><prtrow><item>020</item><prtnbr>622-4957-001</prtnbr><qty>1</qty></prtrow></prtlist></dpfigure></subject><subject chapnbr="23" id="sj232000" sectnbr="20" subjnbr="10"><dpfigure chg="u" figcnt="20" id="sj23200010"><prtlist><prtrow><item>105</item><prtnbr>1071-001</prtnbr><qty>1</qty></prtrow><prtrow><item>015</item><prtnbr>72254-91</prtnbr><qty>1</qty></prtrow><prtrow><item>025</item><prtnbr>3254-93</prtnbr><qty>1</qty></prtrow><prtrow><item>030</item><prtnbr>62-4957-001</prtnbr><qty>1</qty></prtrow></prtlist></dpfigure></subject><subject chapnbr="23" id="sj232000" sectnbr="20" subjnbr="20"><dpfigure chg="u" figcnt="30" id="sj23200010"><prtlist><prtrow><item>005</item><prtnbr>MK1071-001</prtnbr><qty>1</qty></prtrow><prtrow><item>010</item><prtnbr>54AB-91</prtnbr><qty>1</qty></prtrow><prtrow><item>015</item><prtnbr>3254-LO</prtnbr><qty>1</qty></prtrow><prtrow><item>020</item><prtnbr>JT-4957-001</prtnbr><qty>1</qty></prtrow></prtlist></dpfigure></subject></section></chapter> Here is part of the XSL file: <xsl:apply-templates select="//subject"> <xsl:sort select="prtnbr"></xsl:apply-templates><xsl:template match="subject"> <xsl:variable name="chsecsub"> <xsl:value-of select="@chapnbr"/> <xsl:text>-</xsl:text> <xsl:value-of select="@sectnbr"/> <xsl:text>-</xsl:text> <xsl:value-of select="@subjnbr"/> </xsl:variable> <xsl:for-each select="dpfigure"> <xsl:variable name="figcnt" select="@figcnt"/> <xsl:for-each select="prtlist/prtrow"> <fo:table-row> <fo:table-cell> <fo:block> <xsl:value-of select="prtnbr"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:value-of select="$chsecsub"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:value-of select="$figcnt"/> </fo:block> </fo:table-cell> <fo:table-cell text-align="center"> <fo:block> <xsl:value-of select="item"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:value-of select="qty"/> </fo:block> </fo:table-cell> </fo:table-row> </xsl:for-each> </xsl:for-each> </xsl:template> Here is the desired output: Part Number Ch/Sec/Sub Fig. Item Qty.1071-001 23-20-10 20 105 13254-93 23-20-10 20 025 13254-LO 23-20-20 30 015 1372254-91 23-20-00 10 010 1372254-93 23-20-00 10 015 154AB-91 23-20-20 30 010 1622-4957-001 23-20-00 10 020 1623-4957-001 23-20-10 20 030 172254-91 23-20-10 20 015 1822-1071-001 23-20-00 10 005 1JT-4957-001 23-20-20 30 020 1MK1071-001 23-20-20 30 005 1 Any help would be greatly appreciated as I have been struggling with this for several days now.
  19. scopley

    Text Entity

    I am currently converting an XML DTD to XSD Schema. The DTD has several text entities declared and since those entities are already linked within the documents I need to be able to delcare them within the XSD as well. Can anyone tell me how to do this?Thanks!
  20. I am currently writing a XSL:FO style sheet, when I apply it to my xml file it will not read my CGM graphic files. Does anyone know of a Image Reader library that will handle CGM files? I have downloaded and installed the JIMI image library, which took care of 1 problem, but it still won't recognize the cgm files. I am getting this error when producing my output PDFError while creating area : No ImageReader for this type of image
  21. I am looking for a way to combine over 100 xml files located in the same directory into 1 xml file during transformation. I know that I can use variables to acess the data from the different files but to list each file individually is cumberson and they will be subject to change. Is there a .xml wildcard that will pull all the .xml files within a specific directory?Here is the code:<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:variable name="allxml" select="document('C:\TEST\mp200090.xml') /mpc/idinfo/cardno | document('C:\TEST\ma500010.xml') /mpc/idinfo/cardno | document('C:\TEST\mq000010.xml') /mpc/idinfo/cardno"/> <xsl:template match="/"> <xsl:for-each select="$allxml"> <mpcnum> <xsl:value-of select="."/> </mpcnum> </xsl:for-each> </xsl:template></xsl:stylesheet>Thanks in advance for your help.
  22. My final goal is to id tasks and steps. Should look like this:XML Input file:<procblk>!--THIS IS PRELIMINARY STEPS - TASK 01--!<presteps><seqlist numstyle="alphalc"><item><paratext>TEXT</paratext></item></seqlist></presteps>!--THIS SHOULD BE TASK 02--!<procsteps><seqlist numstyle="alphalc"><title>TITLE 1</title><item><paratext>TEXT</paratext></item>!--THIS SHOULD BE TASK 03--!<seqlist numstyle="alphalc"><title>TITLE 2</title><item><paratext>TEXT</paratext></item></prosteps></problk>XML Desired Output:<task id="tk01"><title>PRELIMINARY STEPS</title><step1 id="st0101><para>TEXT</para></step1></task><task id="tk02"><title>TITLE 1</title><step1 id="st0201><para>TEXT</para></step1></task><task id="tk03"><title>TITLE 2</title><step1 id="st0301><para>TEXT</para></step1></task>Thanks for your help!
  23. I am trying to create a global variable to number specific elements during transformation. I need to be able to count different elements throughout the original xml. The original XML would look like this:<procblk><presteps><seqlist numstyle="alphalc"><item><paratext>TEXT</paratext></item></seqlist></presteps><procsteps><seqlist numstyle="alphalc"><title>TITLE 1</title><item><paratext>TEXT</paratext></item><seqlist numstyle="alphalc"><title>TITLE 2</title><item><paratext>TEXT</paratext></item></prosteps></problk>I am trying to create a variable that will count the presteps element and the title element within the procsteps element. Based on the XML above the desired result is:<presteps> = 01TITLE1 = 02TITLE2 = 03The best I can get is 01 for each. Any help would be greatly appreciated.
  24. Thanks that seemed to do the trick.
  25. The original XML file is not very well structured and I do not have control over it to be able to update it.The code did not pull exactly what I wanted but I changed preceding to following and it worked, however it is still duplicating the same caution above every step 2.Thanks so much for your help. XSLT is new to me and any help is greatly appreciated.
×
×
  • Create New...