XSLT를 사용하여 IDML 파일을 처리하고 있습니다.형제 요소의 자식을 통해 그룹화
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Story>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/para">
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
<Content>All rights reserved. No part of this publication may be reproduced in any material form (including photocopying or storing it in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication) without the written permission of the copyright owner except in accordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the </Content>
</CharacterStyleRange>
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/italic">
<Content>Copyright Licensing Agency Ltd, Saffron House, 6-10 Kirby Street, London, EC1N 8TS England</Content>
</CharacterStyleRange>
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
<Content>. Applications for the copyright owner’s written permission to reproduce any part of this publication should be addressed to the publisher.</Content>
<Br/>
<Content>Warning: The doing of an unauthorised act in relation to a copyright work may result in both a civil claim for damages and criminal prosecution.</Content>
<Br/>
<Content>Crown copyright material is reproduced with the permission of the Controller of HMSO and the Queen’s Printer for Scotland.</Content>
<Br/>
</CharacterStyleRange>
</ParagraphStyleRange>
</Story>
지금, 나는처럼 보이는 XML이 점을 설정해야합니다 : 폼 인디자인을 내 보낸 IDML에서,이 (내 입력 XML)와 같은 <Br/>
태그로 구분하여 함께 같은 스타일의 consequtive 단락을 실행 이
<?xml version="1.0" encoding="UTF-8"?>
<story>
<para>All rights reserved. No part of this publication may be reproduced in any material form (including photocopying or storing it in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication) without the written permission of the copyright owner except in accordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the <italic>Copyright Licensing Agency Ltd, Saffron House, 6-10 Kirby Street, London, EC1N 8TS England</italic>. Applications for the copyright owner’s written permission to reproduce any part of this publication should be addressed to the publisher.</para>
<para>Warning: The doing of an unauthorised act in relation to a copyright work may result in both a civil claim for damages and criminal prosecution.</para>
<para>Crown copyright material is reproduced with the permission of the Controller of HMSO and the Queen’s Printer for Scotland.</para>
</story>
내 XSL은 다음과 같습니다 : 거의 012,347,871에서 분할되는 첫 번째 para
제외하고, 작동
<?xml version="1.0" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/Story">
<story>
<xsl:apply-templates/>
</story>
</xsl:template>
<xsl:template match="ParagraphStyleRange">
<xsl:apply-templates>
<xsl:with-param name="para_style_name" select="replace(./@AppliedParagraphStyle, 'ParagraphStyle/', '')"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="CharacterStyleRange">
<xsl:param name="para_style_name"/>
<xsl:variable name="char_style_name" select="replace(./@AppliedCharacterStyle, 'CharacterStyle/', '')"/>
<xsl:for-each-group select="*" group-ending-with="Br">
<xsl:element name="{$para_style_name}">
<xsl:choose>
<xsl:when test="$char_style_name = '$ID/[No character style]'">
<xsl:apply-templates select="current-group()"/>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$char_style_name}">
<xsl:apply-templates select="current-group()"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:for-each-group>
</xsl:template>
<xsl:template match="Content">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="Br"/>
</xsl:stylesheet>
을부분. 예상대로 여러 통해 입력에서 CharacterStyleRange
요소에 걸쳐있는 경우
<?xml version="1.0" encoding="UTF-8"?>
<story>
<para>All rights reserved. No part of this publication may be reproduced in any material form (including photocopying or storing it in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication) without the written permission of the copyright owner except in accordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the </para>
<para><italic>Copyright Licensing Agency Ltd, Saffron House, 6-10 Kirby Street, London, EC1N 8TS England</italic></para>
<para>. Applications for the copyright owner’s written permission to reproduce any part of this publication should be addressed to the publisher.</para>
<para>Warning: The doing of an unauthorised act in relation to a copyright work may result in both a civil claim for damages and criminal prosecution.</para>
<para>Crown copyright material is reproduced with the permission of the Controller of HMSO and the Queen’s Printer for Scotland.</para>
</story>
내 그룹화 방법은 작동하지 않습니다. 그러나 이것이 작동 할 수있는 그룹핑 방법이 있습니까? 또는 CharacterStyleRange
및 ParagraphStyleRange
을 모두 Br
에 종료하고 처리를 쉽게하기 위해 중간 단계로 다시 열기와 같은 다른 접근 방법을 사용하는 것이 더 좋습니다.