如何使用java检查RSS 2.0中<description>元素的长度。如果长度超过200字,请删除项目&lt;&gt;元件

时间:2017-11-24 10:01:45

标签: java xml xslt xml-parsing rss

下面我有一个RSS版本2.0 XML文件。我必须在java中进行编码 - (下面的内容不应超过200的字符限制。如果字符限制超过200,则整个应该从XML中删除)。 虽然我从互联网上得到的一些提示,我发现XML DOM,Parsing将用于此任务。现在请给我解决方案,如果有人有。 谢谢。

<rss version="2.0"
    xmlns:g="http://base.google.com/ns/1.0">
    <channel>
        <item>
            <g:id>00070283-05a7-40ed-808a-061d16828df6</g:id>
            <title>1994 Dodge Ram 2500 (Generic) A/C Accumulator</title>
            <g:description>A/c accumulator; v6 engine. It fits sub-model(s) (Base, Sport, LT, ST, Laramie, WS, SS/T 5.9L, SLT) and (10C 8.0L , 8C 5.2L , 6C 3.7L , 8C 5.9L , 6C 5.9L , 6C 3.9L , 8C 4.7L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Generic/A%2FC_Accumulator/ACM010029/1994/Dodge/Ram_2500</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/682/ACM010029.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>32.68 USD</g:price>
            <g:product_type>HVAC &amp;gt; A/C Accumulator / Receiver Drier &amp;gt; A/C Accumulator</g:product_type>
            <g:brand>Generic</g:brand>
            <g:gtin>615343944418</g:gtin>
            <g:mpn>ACM010029</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>ACM010029</g:item_group_id>
            <g:custom_label_0>1994</g:custom_label_0>
            <g:custom_label_1>Dodge</g:custom_label_1>
            <g:custom_label_2>Ram 2500</g:custom_label_2>
            <g:google_product_category>888</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Generic/A%2FC_Accumulator/ACM010029/1994/Dodge/Ram_2500</g:adwords_redirect>
        </item>
        <item>
            <g:id>0010c520-d786-4cbb-9dd6-271ca93f073d</g:id>
            <title>2015 BMW 640i (Platinum Plus) Wheel-Front</title>
            <g:description>Alloy wheel; 20 x 8.5; 10 spoke; 5 lug; 120mm bp; machined and dark silver. It fits sub-model(s) (Base) and (6C 3.0L , 8C 4.4L , 4C 2.0L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Platinum_Plus/Wheel/Front/ALY71424U10/2015/BMW/640i</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/886/ALY71424U10.jpg</g:image_link>
            <g:availability>out of stock</g:availability>
            <g:price>201.74 USD</g:price>
            <g:product_type>Tire and Wheel &amp;gt; Wheel &amp;gt; Wheel</g:product_type>
            <g:brand>Platinum Plus</g:brand>
            <g:gtin>840304091065</g:gtin>
            <g:mpn>ALY71424U10</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>ALY71424U10</g:item_group_id>
            <g:custom_label_0>2015</g:custom_label_0>
            <g:custom_label_1>BMW</g:custom_label_1>
            <g:custom_label_2>640i</g:custom_label_2>
            <g:google_product_category>8464</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Platinum_Plus/Wheel/Front/ALY71424U10/2015/BMW/640i</g:adwords_redirect>
        </item>
        <item>
            <g:id>00185092-d0de-4a50-a9f5-cc6e7da16988</g:id>
            <title>2004 Dodge Stratus (Platinum Plus) Wheel</title>
            <g:description>Steel wheel; 15 x 6; solid disc; 5 lug; 100mm bp; ident 251aa; black. It fits sub-model(s) (LX, SXT, LXi, ES, Touring, Base, TSi, GTC, SE Plus, Limited, SE, R/T, LXi Limited) and (6C 3.0L , 6C 2.7L , 4C 2.4L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Platinum_Plus/Wheel/STL02142U45/2004/Dodge/Stratus</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/885/STL02142U45.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>101.63 USD</g:price>
            <g:product_type>Tire and Wheel &amp;gt; Wheel &amp;gt; Wheel</g:product_type>
            <g:brand>Platinum Plus</g:brand>
            <g:gtin>615343069395</g:gtin>
            <g:mpn>STL02142U45</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>STL02142U45</g:item_group_id>
            <g:custom_label_0>2004</g:custom_label_0>
            <g:custom_label_1>Dodge</g:custom_label_1>
            <g:custom_label_2>Stratus</g:custom_label_2>
            <g:google_product_category>911</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Platinum_Plus/Wheel/STL02142U45/2004/Dodge/Stratus</g:adwords_redirect>
        </item>
        <item>
            <g:id>002aa329-57e4-4414-ad15-8db71d6db2ca</g:id>
            <title>1992 Plymouth Acclaim (Generic) Engine Oil Pan</title>
            <g:description>Engine oil pan; [gasket not included]. It fits sub-model(s) (LX, ES, Premium, Iroc, Royal, Expresso, GT, Base, Sport, C/V, GTC, High Line, LE, SE, LS, Duster, Landau) and (6C 3.0L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Generic/Engine_Oil_Pan/SPICRP01A/1992/Plymouth/Acclaim</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/660/SPICRP01A.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>94.62 USD</g:price>
            <g:product_type>Engine &amp;gt; Cylinder Block Components &amp;gt; Engine Oil Pan</g:product_type>
            <g:brand>Generic</g:brand>
            <g:gtin>615343401799</g:gtin>
            <g:mpn>SPICRP01A</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>SPICRP01A</g:item_group_id>
            <g:custom_label_0>1992</g:custom_label_0>
            <g:custom_label_1>Plymouth</g:custom_label_1>
            <g:custom_label_2>Acclaim</g:custom_label_2>
            <g:google_product_category>2550</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Generic/Engine_Oil_Pan/SPICRP01A/1992/Plymouth/Acclaim</g:adwords_redirect>
        </item>
        <item>
            <g:id>002ad22c-37d2-4aa4-8d80-39c47872d1b3</g:id>
            <title>1981 Chevrolet K30 (Goodmark) Quarter Panel-Rear Right Lower</title>
            <g:description>Passenger side lower rear quarter panel patch. It fits sub-model(s) (Deluxe, Indy Hauler, Silverado, Sierra Grande, SLE, Base, Sierra Classic, Cheyenne, Scottsdale, Street Coupe, High Sierra, Big Ten, Custom Deluxe, Heavy Half, Custom) and (8C 5.7L , 6C 4.1L , 8C 7.4L , 8C 5.0L , 6C 4.3L , 8C 6.6L , 6C 4.8L , 8C 6.2L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Goodmark/Quarter_Panel/Rear+Right+Lower/GMK4144690731R/1981/Chevrolet/K30</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/444/GMK4144690731R.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>63.74 USD</g:price>
            <g:product_type>Body &amp;gt; Quarter Panel &amp;gt; Quarter Panel</g:product_type>
            <g:brand>Goodmark</g:brand>
            <g:gtin>615343742823</g:gtin>
            <g:mpn>GMK4144690731R</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>GMK4144690731R</g:item_group_id>
            <g:custom_label_0>1981</g:custom_label_0>
            <g:custom_label_1>Chevrolet</g:custom_label_1>
            <g:custom_label_2>K30</g:custom_label_2>
            <g:google_product_category>8227</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Goodmark/Quarter_Panel/Rear+Right+Lower/GMK4144690731R/1981/Chevrolet/K30</g:adwords_redirect>
        </item>
        <item>
            <g:id>002fbe0d-dd4d-4ce9-8c38-687d503ac591</g:id>
            <title>2000 Chevrolet Suburban 2500 (Platinum Plus) Wheel</title>
            <g:description>Alloy wheel; 16 x 7; 31mm offset; 5 spokes; 6 lug; 5.5 inch bp; polished. It fits sub-model(s) (On Road Edition, Base, North Face, LT, Limited, LS, Z71) and (8C 6.0L , 8C 5.3L , 8C 5.7L , 8C 8.1L , 6C 4.3L , 8C 4.8L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Platinum_Plus/Wheel/ALY05096U80/2000/Chevrolet/Suburban_2500</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/886/ALY05096U80.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>239.51 USD</g:price>
            <g:product_type>Tire and Wheel &amp;gt; Wheel &amp;gt; Wheel</g:product_type>
            <g:brand>Platinum Plus</g:brand>
            <g:gtin>615343017655</g:gtin>
            <g:mpn>ALY05096U80</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>ALY05096U80</g:item_group_id>
            <g:custom_label_0>2000</g:custom_label_0>
            <g:custom_label_1>Chevrolet</g:custom_label_1>
            <g:custom_label_2>Suburban 2500</g:custom_label_2>
            <g:google_product_category>911</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Platinum_Plus/Wheel/ALY05096U80/2000/Chevrolet/Suburban_2500</g:adwords_redirect>
        </item>
        <item>
            <g:id>00330b94-fee4-4b51-b937-3a0beb37b5f3</g:id>
            <title>2000 Ford F-250 Super Duty (Generic) Step Nerf Bar</title>
            <g:description>Driver and passenger side pair of round stainless steel side step bars for super cab models; by proefx. It fits sub-model(s) (XL, King Ranch, FX4, Harley-Davidson Edition, Lariat, XLT) and (8C 6.0L , 8C 6.4L , 8C 7.3L , 10C 6.8L , 8C 5.4L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Generic/Step_Nerf_Bar/EFX21007/2000/Ford/F-250_Super_Duty</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/447/EFX21007.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>236.75 USD</g:price>
            <g:product_type>Body &amp;gt; Rocker Panel &amp;gt; Step Nerf Bar</g:product_type>
            <g:brand>Generic</g:brand>
            <g:gtin>615343108988</g:gtin>
            <g:mpn>EFX21007</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>EFX21007</g:item_group_id>
            <g:custom_label_0>2000</g:custom_label_0>
            <g:custom_label_1>Ford</g:custom_label_1>
            <g:custom_label_2>F-250 Super Duty</g:custom_label_2>
            <g:google_product_category>8450</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Generic/Step_Nerf_Bar/EFX21007/2000/Ford/F-250_Super_Duty</g:adwords_redirect>
        </item>
        <item>
            <g:id>0035be52-ab4a-4632-bed0-be9f6cf65a07</g:id>
            <title>1971 Buick Skylark (Goodmark) Trunk Floor Brace-Right</title>
            <g:description>Trunk floor brace rh. It fits sub-model(s) (Luxury, Concours, Nomad, Safari, 300 Deluxe, GSX, Cruiser, 350, GT, Base, Sport, Malibu, 300, Concours Estate, Greenbrier, SS, The Judge, T37, Custom, S) and (8C 5.3L , 8C 5.7L , 6C 4.1L , 8C 7.5L , 8C 7.4L , 8C 5.0L , -C -L , 8C 6.5L , 8C 6.6L , 6C 3.8L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Goodmark/Trunk_Floor_Brace/Right/GMK403274068R/1971/Buick/Skylark</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/444/GMK403274068R.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>63.74 USD</g:price>
            <g:product_type>Body &amp;gt; Trunk Lid and Compartment &amp;gt; Trunk Floor Brace</g:product_type>
            <g:brand>Goodmark</g:brand>
            <g:gtin>615343759463</g:gtin>
            <g:mpn>GMK403274068R</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>GMK403274068R</g:item_group_id>
            <g:custom_label_0>1971</g:custom_label_0>
            <g:custom_label_1>Buick</g:custom_label_1>
            <g:custom_label_2>Skylark</g:custom_label_2>
            <g:google_product_category>8450</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Goodmark/Trunk_Floor_Brace/Right/GMK403274068R/1971/Buick/Skylark</g:adwords_redirect>
        </item>
        <item>
            <g:id>003ea2e4-c32a-4a31-9321-0fa70f30bb40</g:id>
            <title>2008 Kia Sedona (Platinum Plus) Wheel</title>
            <g:description>Alloy wheel; 17 x 6.5; 12 spokes; 5 lug; 115mm bp; machined and black. It fits sub-model(s) (EX, LX, Base) and (6C 3.8L , 6C 3.5L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Platinum_Plus/Wheel/ALY74639U45/2008/Kia/Sedona</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/886R/ALY74639U45.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>166.65 USD</g:price>
            <g:product_type>Tire and Wheel &amp;gt; Wheel &amp;gt; Wheel</g:product_type>
            <g:brand>Platinum Plus</g:brand>
            <g:gtin>840304095292</g:gtin>
            <g:mpn>ALY74639U45</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>ALY74639U45</g:item_group_id>
            <g:custom_label_0>2008</g:custom_label_0>
            <g:custom_label_1>Kia</g:custom_label_1>
            <g:custom_label_2>Sedona</g:custom_label_2>
            <g:google_product_category>6088</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Platinum_Plus/Wheel/ALY74639U45/2008/Kia/Sedona</g:adwords_redirect>
        </item>
        <item>
            <g:id>004795da-8441-4b6d-b883-467a5e256ea7</g:id>
            <title>2005 Lexus GX470 (Generic) Wheel</title>
            <g:description>Alloy wheel take off; 17 x 7.5; 25mm offset; 5 split spokes; 6 lug; 5.5 inch bp; used; silver. It fits sub-model(s) (Base) and (8C 4.7L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Generic/Wheel/ALY74167U20U1/2005/Lexus/GX470</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/886R/ALY74167U20U1.jpg</g:image_link>
            <g:availability>out of stock</g:availability>
            <g:price>246.68 USD</g:price>
            <g:product_type>Tire and Wheel &amp;gt; Wheel &amp;gt; Wheel</g:product_type>
            <g:brand>Generic</g:brand>
            <g:gtin>191275039861</g:gtin>
            <g:mpn>ALY74167U20U1</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>ALY74167U20U1</g:item_group_id>
            <g:custom_label_0>2005</g:custom_label_0>
            <g:custom_label_1>Lexus</g:custom_label_1>
            <g:custom_label_2>GX470</g:custom_label_2>
            <g:google_product_category>500077</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Generic/Wheel/ALY74167U20U1/2005/Lexus/GX470</g:adwords_redirect>
        </item>
        <item>
            <g:id>004ad792-fa30-495c-9925-178d37f2122f</g:id>
            <title>1992 GMC C2500 (Generic) Dash Panel Overlay</title>
            <g:description>Dash cap; fits gm full size pick up/blazer and suburban. It fits sub-model(s) (454 SS, Silverado Sport, Sierra SLX, Silverado, SLE, WT, GT, Sierra Sport, Base, Sport, Sierra SL, Sierra, Cheyenne, Scottsdale, Sierra SLT, Sierra SLE, Sierra Special) and (8C 5.7L , 8C 7.4L , 8C 5.0L , 6C 4.3L , 8C 6.5L , 8C 6.2L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Generic/Dash_Panel_Overlay/DCV010005/1992/GMC/C2500</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/662/DCV010005.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>252.59 USD</g:price>
            <g:product_type>Body &amp;gt; Dash &amp;gt; Dash Panel Overlay</g:product_type>
            <g:brand>Generic</g:brand>
            <g:gtin>615343872049</g:gtin>
            <g:mpn>DCV010005</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>DCV010005</g:item_group_id>
            <g:custom_label_0>1992</g:custom_label_0>
            <g:custom_label_1>GMC</g:custom_label_1>
            <g:custom_label_2>C2500</g:custom_label_2>
            <g:google_product_category>2582</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Generic/Dash_Panel_Overlay/DCV010005/1992/GMC/C2500</g:adwords_redirect>
        </item>
        <item>
            <g:id>0050f723-8ff5-4433-92d6-4065be24c540</g:id>
            <title>2003 Ford Explorer (Platinum Plus) Wheel</title>
            <g:description>Alloy wheel; 16 x 7; 5 spokes; 5 lug; 4.5 inch bp; polished. It fits sub-model(s) (STX, XL, FX4, XL Fleet, Sport, Sport XLT, EV, Tremor, Limited, Splash, Edge, XLT Sport, XLT) and (4C 2.5L , 8C 4.6L , 6C 4.0L , 8C 5.0L , 4C 2.3L , -C -L , 6C 3.0L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Platinum_Plus/Wheel/ALY03293A80/2003/Ford/Explorer</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/886R/ALY03293A80.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>224.11 USD</g:price>
            <g:product_type>Tire and Wheel &amp;gt; Wheel &amp;gt; Wheel</g:product_type>
            <g:brand>Platinum Plus</g:brand>
            <g:gtin>615343007830</g:gtin>
            <g:mpn>ALY03293A80</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>ALY03293A80</g:item_group_id>
            <g:custom_label_0>2003</g:custom_label_0>
            <g:custom_label_1>Ford</g:custom_label_1>
            <g:custom_label_2>Explorer</g:custom_label_2>
            <g:google_product_category>7253</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Platinum_Plus/Wheel/ALY03293A80/2003/Ford/Explorer</g:adwords_redirect>
        </item>
        <item>
            <g:id>005b5ec7-6512-41af-b273-f047cce8a1d0</g:id>
            <title>1983 Oldsmobile Omega (Generic) Engine Oil Pan Gasket</title>
            <g:description>Engine oil pan gasket. It fits sub-model(s) (Cruiser LS, DL, DL SX4, Safari, DL Kammback, SX4, ESC, ES, Durango, Golden Hawk, Laredo, Renegade, Holiday, Spyder, SLE, Olympia Limited, SL, GT, CL, Eurosport, Base, Sport, 2+2 Sport, Limited, Sierra Classic, LE, Timberline, High Country, SE, SLS, LS, Gypsy, Golden Eagle, SX, High Sierra, CS, X-11, EL, 2+2, SLX, Firenza, 2+2 Spyder, Custom, Brougham, Classic, Tahoe, S/E, LJ, Estate, Estate Wagon, Club, Value Leader, S, Kammback, SR) and (4C 2.5L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Generic/Engine_Oil_Pan_Gasket/SPIGK76/1983/Oldsmobile/Omega</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/660/SPIGK76.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>22.39 USD</g:price>
            <g:product_type>Engine &amp;gt; Gaskets and Sealing Systems &amp;gt; Engine Oil Pan Gasket</g:product_type>
            <g:brand>Generic</g:brand>
            <g:gtin>615343402765</g:gtin>
            <g:mpn>SPIGK76</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>SPIGK76</g:item_group_id>
            <g:custom_label_0>1983</g:custom_label_0>
            <g:custom_label_1>Oldsmobile</g:custom_label_1>
            <g:custom_label_2>Omega</g:custom_label_2>
            <g:google_product_category>3321</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Generic/Engine_Oil_Pan_Gasket/SPIGK76/1983/Oldsmobile/Omega</g:adwords_redirect>
        </item>
        <item>
            <g:id>006139d0-ff6b-447e-a042-1e2842a37702</g:id>
            <title>2012 Nissan Versa (Generic) Door Mirror-Right</title>
            <g:description>Passenger side power door mirror; new style; paint to match; fits sedan and hatchback. It fits sub-model(s) (1.6 Base, 1.6 SV, 1.6 S, 1.8 SL, SL, 1.6 SL, 1.6, 1.8 S, S) and (4C 1.6L , 4C 1.8L ) engine(s).</g:description>
            <link>https://theautopartsshop.com/sku/Generic/Door_Mirror/Right/NI1321200/2012/Nissan/Versa</link>
            <g:image_link>https://images.theautopartsshop.com/lkq/665/NI1321200.jpg</g:image_link>
            <g:availability>in stock</g:availability>
            <g:price>49.84 USD</g:price>
            <g:product_type>Body &amp;gt; Mirrors &amp;gt; Door Mirror</g:product_type>
            <g:brand>Generic</g:brand>
            <g:gtin>615343184395</g:gtin>
            <g:mpn>NI1321200</g:mpn>
            <g:condition>new</g:condition>
            <g:item_group_id>NI1321200</g:item_group_id>
            <g:custom_label_0>2012</g:custom_label_0>
            <g:custom_label_1>Nissan</g:custom_label_1>
            <g:custom_label_2>Versa</g:custom_label_2>
            <g:google_product_category>2642</g:google_product_category>
            <g:shipping>
                <g:country>US</g:country>
                <g:region/>
                <g:service/>
                <g:price>0.00 USD</g:price>
            </g:shipping>
            <g:adwords_redirect>https://tracking.theautopartsshop.com/?campaignid={campaignid}&amp;adgroupid={adgroupid}&amp;feeditemid={feeditemid}&amp;targetid={targetid}&amp;matchtype={matchtype}&amp;network={network}&amp;device={device}&amp;devicemodel={devicemodel}&amp;creative={creative}&amp;keyword={keyword}&amp;placement={placement}&amp;target={target}&amp;adposition={adposition}&amp;url=https://theautopartsshop.com/sku/Generic/Door_Mirror/Right/NI1321200/2012/Nissan/Versa</g:adwords_redirect>
        </item>
        <item>

2 个答案:

答案 0 :(得分:0)

下载Saxon并运行此XSLT 3.0样式表:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="3.0">
<xsl:mode on-no-match="shallow-copy"/>
<xsl:template match="text()[string-length(.) gt 200]"/>
</xsl:stylesheet>

答案 1 :(得分:0)

我会&#34;翻译&#34;要求&#34;如果描述长度超过200字,删除项目&#34;进入XSLT 3(由例如Saxon 9.8执行)

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">

<xsl:mode on-no-match="shallow-copy"/>

<xsl:template match="item[count(tokenize(g:description, '\s+')) gt 200]"  xmlns:g="http://base.google.com/ns/1.0"/>

</xsl:stylesheet>

一般来说,明显的单词计数比简单地在空格上进行标记更复杂,但如果需要,您可以使用analyze-string函数或编写您调用的自定义函数而不是tokenize