나는 그런 XML이 불필요한 요소를 제거 :XML 레이아웃 변경 - XML 요소 값을 곱하기 요소로 나눕니다.
<StockInfo>
<Item>
<stockcode>111111</stockcode>
<vehicle>Ford</vehicle>
<model>Escape (2000-)~Maverick (2001-)</model>
<width>8</width>
<wheel_size>18</wheel_size>
<offset>35</offset>
<bolt_pattermn>5x114.3</bolt_pattermn>
<brand>ANTERA</brand>
<Velg_ID/>
<kit1>DK-135259671 x1</kit1>
<kit2/>
<kit3/>
<kit4/>
<qty_available>3.00000000</qty_available>
<price>1110.00</price>
<picture>410110
</picture>
</Item>
<Item>
<stockcode>111111</stockcode>
<vehicle>Honda</vehicle>
<model>Civic (5skr,2001-2006)(2006-)~Accord (2003-2008)~Acord Coupe (1999-)~Acord Type R~Civic Type R (2001-2006)(2007-,17"<)~Civic Type S (2001-2006)(2007-,17"<)~Integra Type R~Prelude (1997-2001)~Legend (1991-1999)</model>
<width>8</width>
<wheel_size>18</wheel_size>
<offset>40</offset>
<bolt_pattermn>5x114.3</bolt_pattermn>
<brand>ANTERA</brand>
<Velg_ID/>
<kit1>DK-135259641 x1</kit1>
<kit2/>
<kit3/>
<kit4/>
<qty_available>3.00000000</qty_available>
<price>1110.00</price>
<picture>410110
</picture>
</Item>
<Item>
<stockcode>2222222</stockcode>
<vehicle>BMW</vehicle>
<model>6 (e63/64, 2004-2011)~M6 (e63/64, 2004-2011)</model>
<width>9</width>
<wheel_size>18</wheel_size>
<offset>15</offset>
<bolt_pattermn>5x120</bolt_pattermn>
<brand>AEZ</brand>
<Velg_ID>AEZ Ares</Velg_ID>
<kit1>DK-ZJB3 x1</kit1>
<kit2/>
<kit3/>
<kit4/>
<qty_available>4.00000000</qty_available>
<price>151110.00</price>
<picture>41001
</picture>
</Item>
</StockInfo>
당신은이 개 동일한 항목이 보시다시피 (같은 stockcode와; 항목은 자동차 바퀴입니다) 1 개 다른 항목을 ... 같은 항목은 X 시간이 될 수 있습니다 모든 다른 자동차 모델 (이 휠이 Audi A3, Audi A4, Citroen X에 적합하면 XML로 3 번, 다른 모든 요소는 제외하고 같은 값을 가짐)를 XML로 변환합니다.
내 질문 :
분리하는 방법/분할 요소
<model>
: X 요소로<model>Civic (5skr,2001-2006)(2006-)~Accord (2003-2008)~Acord Coupe (1999-)~Acord Type R~Civic Type R (2001-2006)(2007-,17"<)~Civic Type S (2001-2006)(2007-,17"<)~Integra Type R~Prelude (1997-2001)~Legend (1991-1999)</model>
이 <model>
<model>Civic (5skr,2001-2006)(2006-)</model>
<model>Accord (2003-2008)</model>
<model>Acord Coupe (1999-)</model>
<model>Acord Type R</model>
<model>Civic Type R (2001-2006)(2007-,17"<)</model>
<model>Civic Type S (2001-2006)(2007-,17"<)</model>
<model>Integra Type R</model>
<model>Prelude (1997-2001)</model>
<model>Legend (1991-1999)</model>
분리 기호가 " ~ "
는 지금까지 내가 (둘 다 PHP,도 XSL 변환을 사용하여) 때문에 도움 ;-(
방법 그룹 동일한
<stockode>
있는 항목을하려면 1 개<Item>
루트에 대신 찾고 그것을 할 수 없습니다 X의?동일한 값을 가진 요소를 제거하는 방법 (내가 말했듯이 휠이 여러 자동차 모델에 적합하다면 여러 다른 요소를 사용하여 XML에 여러 번 표시 될 수 있습니다 (때로는
<vehicle>
-이 휠이 몇 자동차 모델에만 적합))?
그래서 수정 된 XML은 같아야합니다
<StockInfo>
<Item>
<stockcode>111111</stockcode>
<vehicle>Ford</vehicle>
<model>Escape (2000-)~Maverick (2001-)</model>
<vehicle>Ford</vehicle>
<model>Civic (5skr,2001-2006)(2006-)</model>
<model>Accord (2003-2008)</model>
<model>Acord Coupe (1999-)</model>
<model>Acord Type R</model>
<model>Civic Type R (2001-2006)(2007-,17"<)</model>
<model>Civic Type S (2001-2006)(2007-,17"<)</model>
<model>Integra Type R</model>
<model>Prelude (1997-2001)</model>
<model>Legend (1991-1999)</model>
<wheel_size>18</wheel_size>
<offset>35</offset>
<offset>40</offset>
<bolt_pattermn>5x114.3</bolt_pattermn>
<brand>ANTERA</brand>
<Velg_ID/>
<qty_available>3.00000000</qty_available>
<price>1110.00</price>
<picture>410110
</picture>
</Item>
<Item><stockcode>2222222</stockcode>
<vehicle>BMW</vehicle>
<model>6 (e63/64, 2004-2011)</model>
<model>M6 (e63/64, 2004-2011)</model>
<model>M6 (e63/64, 2004-2011)</model>
<width>9</width>
<wheel_size>18</wheel_size>
<offset>15</offset>
<bolt_pattermn>5x120</bolt_pattermn>
<brand>AEZ</brand>
<Velg_ID>AEZ Ares</Velg_ID>
<qty_available>4.00000000</qty_available>
<price>151110.00</price>
<picture>41001
</picture>
</Item>
</StockInfo>
귀하의 질문은 무엇인가? –
수정 된 게시물을 더 명확하게 내 질문! –