Jump to content

scopley

Members
  • Posts

    28
  • Joined

  • Last visited

scopley's Achievements

Newbie

Newbie (1/7)

0

Reputation

  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. 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.
  3. 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!
  4. 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.
  5. Thanks that seemed to do the trick.
  6. 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.
  7. In the final output the caution that begins "Improper seating" repeats above every step2. I need it to just show up once above the step2 that starts out "Ensure rubber pads are on clamps.".
  8. I am in the process of writing a transformation script. I am able to get my text to come in but it is coming in multiple times. I am getting the same caution preceding every step 2 within the document.Here is my stylesheet code:<xsl:for-each select="seqlist/item"> <step2> <xsl:if test="preceding::seqlist/caution"> <caution> <para> <xsl:value-of select="$st2caution/paratext"/> </para> </caution> </xsl:if> <para> <xsl:value-of select="paratext"/> </para>Here is my original XML file:<seqlist numstyle="alphalc"> <title id="clean1">Clean and Inspect Indicator Assy F500.</title> <note id="notesor01"> <paratext> <emphasis type="bold">Statement of Relevance</emphasis> - This task prevents corroded, seized indicator assembly.</paratext> </note> <item> <paratext>Remove blower hood assembly.</paratext> <seqlist numstyle="arabic-parens"> <item> <paratext>Clean vents and hood.</paratext> </item> <item> <paratext>Inspect gasket for deteriorationor damage.</paratext> </item> <item> <paratext>Inspect fan for damage.</paratext> </item> <item> <paratext>Inspect wiring for burned, loose, or brokenconnections.</paratext> </item> </seqlist> </item> <caution> <paratext>Do not handle source lamp glass envelopes with bare fingers. Coverlamp with clean, lint-free cloth or tissues when removing.</paratext> </caution> <item> <paratext>Remove source lamps.</paratext> <seqlist numstyle="arabic-parens"> <item> <paratext>Carefully remove each sourcelamp using slight left-right rocking motion.</paratext> </item> <item> <paratext>Inspect envelope for etching, bulging, and discoloration;replace lamp if required.</paratext> </item> <item> <paratext>Inspectreflector for discoloration.</paratext> </item> </seqlist> </item> <caution> <paratext>Do not move lamp support assembly. Movement of this bracketassembly will place cell out of optical alignment.</paratext> </caution> <item> <paratext>Remove top auxiliary reflector. Loosen bottom auxiliaryreflector but do not remove it.</paratext> </item> <item> <paratext>Removeground glass lenses from face of mask.</paratext> </item> <item> <paratext>Using metal polish, clean top and bottom halves of reflectors.</paratext> </item> <caution> <paratext>Hold lenses by edges to prevent fingerprintson face of lenses.</paratext> </caution> <warning> <paratext>Avoid inhalationof, ingestion of, skin contact with, and eye contact with hazardousmaterials. Avoid use near heat or open flame and provide adequateventilation. Consult work center supervisor if unsure whether ventilationis adequate and if respiratory protection is necessary.</paratext> </warning> <item> <paratext>Put on goggles and gloves.</paratext> </item> <item> <paratext>Using alcohol, clean ground glass lenses and inspectfor discoloration, surface scratches, etchings, and excessively-chippededges.</paratext> </item> <item> <paratext>Clean lamp mounting plate,masks, and barrier glass at rear of cell.</paratext> </item> <item> <paratext>Remove gloves and goggles.</paratext> </item> <item> <paratext>Reinstallground glass lenses with ground side away from lamps.</paratext> </item> <item> <paratext>Reinstall top auxiliary reflector; tighten bottomauxiliary reflector; and remove any finger smudges.</paratext> </item> <warning> <paratext>Avoid inhalation of, ingestion of, skin contactwith, and eye contact with hazardous materials. Avoid use near heator open flame and provide adequate ventilation. Consult work centersupervisor if unsure whether ventilation is adequate and if respiratoryprotection is necessary.</paratext> </warning> <item> <paratext>Put ongoggles and gloves.</paratext> </item> <item> <paratext>Clean sourcelamps with clean, lint-free cloth or tissues moistened with alcohol;reinstall lamps.</paratext> </item> <item> <paratext>Reinstall blowerhood assembly; apply antiseize compound to screw threads before installing.</paratext> </item> <item> <paratext>Remove gloves and goggles.</paratext> </item> <caution> <paratext>Use of solvents, detergents, or abrasive materialswill result in damage to Fresnel and lenticular lens surfaces.</paratext> </caution> <note id="note2"> <paratext>Particular attention shouldbe paid to the position of Fresnel and lenticular lens surfaces beforeremoval to ensure they are properly reinstalled.</paratext> </note> <item> <paratext>Remove lenticular lens retaining frame and lens.</paratext> <warning> <paratext>Avoid inhalation of, ingestion of, skin contactwith, and eye contact with hazardous materials. Avoid use near heator open flame and provide adequate ventilation. Consult work centersupervisor if unsure whether ventilation is adequate and if respiratoryprotection is necessary.</paratext> </warning> <seqlist numstyle="arabic-parens"> <item> <paratext>Put on goggles and gloves.</paratext> </item> <item> <paratext>Clean lens with mild soap and fresh water;wipe dry.</paratext> </item> <item> <paratext>Inspect lens for cracks,separation of cemented lens segments, scratches, and discoloration.</paratext> </item> <item> <paratext>Remove gloves and goggles.</paratext> </item> <item> <paratext>Inspect lens gasket for damage and deterioration.</paratext> </item> </seqlist> </item> <item> <paratext>Remove Fresnel lens; notelocation of each clamp for later reinstallation in original position.</paratext> <seqlist numstyle="arabic-parens"> <item> <paratext>Wash Fresnel lenswith clean water and soft, lint-free cloth.</paratext> </item> <item> <paratext>Dry lens with lint-free cloth.</paratext> </item> </seqlist> </item> <item> <paratext>Open LH and RH heater enclosures; clean andinspect interior of temperature-controlled section.</paratext> <seqlist numstyle="arabic-parens"> <item> <paratext>Inspect components for generalcondition and evidence of moisture.</paratext> </item> <item> <paratext>Inspect wiring for overheating and deterioration.</paratext> </item> <item> <paratext>Clean interior with clean brush.</paratext> </item> <item> <paratext>Inspect wire terminals for security; tighten if necessary.</paratext> </item> <item> <paratext>Inspect LH and RH heater enclosure gasketsfor damage and deterioration.</paratext> </item> </seqlist> </item> <item> <paratext>Reinstall Fresnel lens.</paratext> <note id="note3"> <paratext>Install lens with smooth side facing interior of cell and slot tothe right when facing front of cell.</paratext> </note> <seqlist numstyle="arabic-parens"> <item> <paratext>Ensure rubber pads are onclamps.</paratext> </item> <caution> <paratext>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</paratext> </caution> <item> <paratext>Reinstallclamps to support Fresnel lens in positions previously recorded.</paratext> </item> <item> <paratext>Tighten clamps at opposite corners until 5to 6 inch-pounds of torque is achieved.</paratext> </item> </seqlist> </item> <item> <paratext>Reinstall tricolor lenticular lens, makingsure green section is up. Start all 6 screws and tighten in sequenceto ensure a good seal is created between frame subassembly and housingassembly.</paratext> </item> </seqlist>Here is my final output:<step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Clean vents and hood.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect gasket for deteriorationor damage.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect fan for damage.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect wiring for burned, loose, or brokenconnections.</para> </step2> </step1> <step1 id="st10202"> <para>Remove source lamps.</para> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Carefully remove each sourcelamp using slight left-right rocking motion.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect envelope for etching, bulging, and discoloration;replace lamp if required.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspectreflector for discoloration.</para> </step2> </step1> <step1 id="st10203"> <para>Remove top auxiliary reflector. Loosen bottom auxiliaryreflector but do not remove it.</para> </step1> <step1 id="st10204"> <para>Removeground glass lenses from face of mask.</para> </step1> <step1 id="st10205"> <para>Using metal polish, clean top and bottom halves of reflectors.</para> </step1> <step1 id="st10206"> <para>Put on goggles and gloves.</para> </step1> <step1 id="st10207"> <para>Using alcohol, clean ground glass lenses and inspectfor discoloration, surface scratches, etchings, and excessively-chippededges.</para> </step1> <step1 id="st10208"> <para>Clean lamp mounting plate,masks, and barrier glass at rear of cell.</para> </step1> <step1 id="st10209"> <para>Remove gloves and goggles.</para> </step1> <step1 id="st10210"> <para>Reinstallground glass lenses with ground side away from lamps.</para> </step1> <step1 id="st10211"> <para>Reinstall top auxiliary reflector; tighten bottomauxiliary reflector; and remove any finger smudges.</para> </step1> <step1 id="st10212"> <para>Put ongoggles and gloves.</para> </step1> <step1 id="st10213"> <para>Clean sourcelamps with clean, lint-free cloth or tissues moistened with alcohol;reinstall lamps.</para> </step1> <step1 id="st10214"> <para>Reinstall blowerhood assembly; apply antiseize compound to screw threads before installing.</para> </step1> <step1 id="st10215"> <para>Remove gloves and goggles.</para> </step1> <step1 id="st10216"> <warning> <para>Avoid inhalation of, ingestion of, skin contactwith, and eye contact with hazardous materials. Avoid use near heator open flame and provide adequate ventilation. Consult work centersupervisor if unsure whether ventilation is adequate and if respiratoryprotection is necessary.</para> </warning> <para>Remove lenticular lens retaining frame and lens.</para> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Put on goggles and gloves.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Clean lens with mild soap and fresh water;wipe dry.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect lens for cracks,separation of cemented lens segments, scratches, and discoloration.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Remove gloves and goggles.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect lens gasket for damage and deterioration.</para> </step2> </step1> <step1 id="st10217"> <para>Remove Fresnel lens; notelocation of each clamp for later reinstallation in original position.</para> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Wash Fresnel lenswith clean water and soft, lint-free cloth.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Dry lens with lint-free cloth.</para> </step2> </step1> <step1 id="st10218"> <para>Open LH and RH heater enclosures; clean andinspect interior of temperature-controlled section.</para> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect components for generalcondition and evidence of moisture.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect wiring for overheating and deterioration.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Clean interior with clean brush.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect wire terminals for security; tighten if necessary.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Inspect LH and RH heater enclosure gasketsfor damage and deterioration.</para> </step2> </step1> <step1 id="st10219"> <note> <para>Install lens with smooth side facing interior of cell and slot tothe right when facing front of cell.</para> </note> <para>Reinstall Fresnel lens.</para> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Ensure rubber pads are onclamps.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Reinstallclamps to support Fresnel lens in positions previously recorded.</para> </step2> <step2> <caution> <para>Improper seating or clampingof Fresnel lens assembly may result in problems in optical alignmentby causing distortion of acrylic material. When lens is reinstalled,use great care to properly seat it and yet permit movement throughexpansion and contraction.</para> </caution> <para>Tighten clamps at opposite corners until 5to 6 inch-pounds of torque is achieved.</para> </step2> </step1> <step1 id="st10220"> <para>Reinstall tricolor lenticular lens, makingsure green section is up. Start all 6 screws and tighten in sequenceto ensure a good seal is created between frame subassembly and housingassembly.</para> </step1>Every time there is a step 2 it puts the same caution above. Can anyone help with this issue?
  9. I am currently writing a transformation script and am down to the last piece. I have it transforming all the data but it is pulling it out of sequence. Here is the code:<xsl:template match="procsteps/seqlist"> <xsl:variable name="taskNum"> <xsl:number value="position()+1" format="01"/> </xsl:variable> <task id="tk{$functionNum}{$taskNum}"> <title> <xsl:value-of select="translate(./title,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/> </title> <xsl:for-each select="./warning"> <warning> <para> <xsl:value-of select="paratext"/> </para> </warning> </xsl:for-each> <xsl:for-each select="./caution"> <caution> <para> <xsl:value-of select="paratext"/> </para> </caution> </xsl:for-each> <xsl:for-each select="./note"> <note> <para> <xsl:value-of select="paratext"/> </para> </note> </xsl:for-each> <xsl:for-each select="./item"> <xsl:variable name="stepNum"> <xsl:number count="item" format="01"/> </xsl:variable> <step1 id="st{$functionNum}{$taskNum}{$stepNum}"> <xsl:if test="./warning"> <warning> <para> <xsl:value-of select="warning/paratext"/> </para> </warning> </xsl:if> <xsl:if test="./caution"> <caution> <para> <xsl:value-of select="caution/paratext"/> </para> </caution> </xsl:if> <xsl:if test="./note"> <note> <para> <xsl:value-of select="note/paratext"/> </para> </note> </xsl:if> <para> <xsl:value-of select="paratext"/> </para>It pulls all the warnings, cautions and notes text but it is putting it at the top I need it to place it above the step where it from. Is there a way for it to pull the text but not sort it? Can anyone help?
×
×
  • Create New...