com.aspose.words
Interface IBibliographyStylesProvider


public interface IBibliographyStylesProvider 

Implement this interface to provide bibliography style for the FieldBibliography and FieldCitation fields when they're updated.

Example:

Shows how to override built-in styles or provide custom one.
public void changeBibliographyStyles() throws Exception
{
    Document doc = new Document(getMyDir() + "Bibliography.docx");

    doc.getFieldOptions().setBibliographyStylesProvider(new BibliographyStylesProvider());
    doc.updateFields();

    doc.save(getArtifactsDir() + "Field.ChangeBibliographyStyles.docx");
}

public static class BibliographyStylesProvider implements IBibliographyStylesProvider
{
    public FileInputStream getStyle(String styleFileName) throws Exception
    {
        return new FileInputStream(getMyDir() + "Bibliography custom style.xsl");
    }
}

Method Summary
abstract System.IO.StreamgetStyle(java.lang.String styleFileName)
           Returns bibliography style.
 

Method Detail

getStyle

public abstract System.IO.Stream getStyle(java.lang.String styleFileName)
                             throws java.lang.Exception
Returns bibliography style. The implementation should return null to indicate that the MS Word version of specified style should be used.
Parameters:
styleFileName - The bibliography style file name.
Returns:
The System.IO.Stream with bibliography style XSLT stylesheet.

Example:

Shows how to override built-in styles or provide custom one.
public void changeBibliographyStyles() throws Exception
{
    Document doc = new Document(getMyDir() + "Bibliography.docx");

    doc.getFieldOptions().setBibliographyStylesProvider(new BibliographyStylesProvider());
    doc.updateFields();

    doc.save(getArtifactsDir() + "Field.ChangeBibliographyStyles.docx");
}

public static class BibliographyStylesProvider implements IBibliographyStylesProvider
{
    public FileInputStream getStyle(String styleFileName) throws Exception
    {
        return new FileInputStream(getMyDir() + "Bibliography custom style.xsl");
    }
}

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.